Вызов метода на Watchkit
Вчера я посетил хакатон watchkit, и у меня возникли проблемы с вызовом метода в классе NSObject, который использует API Карт Google и отправляет локальные уведомления. Если я вызываю этот метод из моего расширения Watchkit, код не компилируется, но если я вызываю, например, из ViewController, все работает отлично
#import "InterfaceController.h"
#import "Methods.h"
@interface InterfaceController()
@end
@implementation InterfaceController
- (instancetype)initWithContext:(id)context {
self = [super initWithContext:context];
if (self){
// Initialize variables here.
// Configure interface objects here.
NSLog(@"%@ initWithContext", self);
}
return self;
}
- (IBAction)butRoute
{
Methods *mt = [[Methods alloc]init];
[mt notif:@"ARRIVING!"];
//***** If I call this method, my code won't compile!!! *****
}
- (void)willActivate {
// This method is called when watch view controller is about to be visible to user
NSLog(@"%@ will activate", self);
}
- (void)didDeactivate {
// This method is called when watch view controller is no longer visible
NSLog(@"%@ did deactivate", self);
}
@end
Я получаю ошибку: