0

'didFinishLaunchingWithOptions'関数で、最後に次の行を指定しています:-

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
    return [super application:application didFinishLaunchingWithOptions:launchOptions]; 

しかし、それは次の警告を与えています:-

'NSObject' may not respond to 'application:didFinishLaunchingWithOptions' function 

そして、それをビルドすると、アプリケーションは「UncaughtExceptionerror」で終了します

なぜこれが起こっているのか誰かが提案できますか?ありがとう

4

2 に答える 2

0

試す

[self application:application didFinishLaunchingWithOptions:launchOptions];

NSObjectのような基本オブジェクトはのメソッドを実装しませんdidFinishLaunchingWithOptions:launchOptions

于 2012-10-01T11:44:28.183 に答える
0

didFinishLaunchingWithOptions:launchOptionsの最後にYESを返す必要があります

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
return YES;
于 2012-10-01T12:24:57.487 に答える