0
AppController.h從另一個控制器調用函數,爲什麼不起作用?
#import <Cocoa/Cocoa.h>
#import "DebugController.h"
@class DebugController;
@interface AppController : NSObject {
DebugController * controller;
}
@end
AppController.m
#import "AppController.h"
@implementation AppController
-(void)awakeFromNib {
NSLog(@"awake");
[controller sendDebug];
}
@end
DebugController.h
#import <Cocoa/Cocoa.h>
#import "AppController.h"
@interface DebugController : NSObject {
}
- (void)sendDebug;
@end
DebugController.m
#import "DebugController.h"
@implementation DebugController
- (void)sendDebug {
NSLog(@"debug"); // no logs.
}
@end