我无法在视图控制器上调用方法或创建变量。我正在使用以下代码,但它不起作用。
// MODEL
@interface MyModel : NSObject
-(void)awesome;
@end
@implementation MyModel
-(void)awesome {
NSLog(@"awesome");
}
@end
// VIEW CONTROLLER
@interface MyViewController: UIViewController
@property (nonatomic, strong) MyModel *modelObject;
@end
@implementation MyViewController
@synthesize modelObject;
-(void)viewDidLoad
{
[self.modelObject awesome];
[super viewDidLoad];
}
@end