2015-01-14 10 views
1

Мое приложение запущено, и его сбой на некоторых устройствах не все, у меня также есть шквал, которые запутывают, они предлагают его сбой в этой функции.Приложение аварийно завершает работу на некоторых устройствах

Эта функция вызывается, когда приложение запускает (он выходит из строя сразу) Любая помощь будет принята с благодарностью

- (void) setupForPushNotifications { 
UIMutableUserNotificationAction *readAction = [[UIMutableUserNotificationAction alloc] init]; 
readAction.identifier = @"READ_IDENTIFIER"; 
readAction.title = @"Read"; 
readAction.activationMode = UIUserNotificationActivationModeForeground; 
readAction.destructive = NO; 
readAction.authenticationRequired = YES; 

UIMutableUserNotificationAction *ignoreAction = [[UIMutableUserNotificationAction alloc] init]; 
ignoreAction.identifier = @"IGNORE_IDENTIFIER"; 
ignoreAction.title = @"Ignore"; 
ignoreAction.activationMode = UIUserNotificationActivationModeBackground; 
ignoreAction.destructive = NO; 
ignoreAction.authenticationRequired = NO; 

UIMutableUserNotificationAction *deleteAction = [[UIMutableUserNotificationAction alloc] init]; 
deleteAction.identifier = @"DELETE_IDENTIFIER"; 
deleteAction.title = @"Delete"; 
deleteAction.activationMode = UIUserNotificationActivationModeForeground; 
deleteAction.destructive = YES; 
deleteAction.authenticationRequired = YES; 

UIMutableUserNotificationCategory *messageCategory = [[UIMutableUserNotificationCategory alloc] init]; 
messageCategory.identifier = @"MESSAGE_CATEGORY"; 
[messageCategory setActions:@[readAction, ignoreAction, deleteAction] forContext:UIUserNotificationActionContextDefault]; 
[messageCategory setActions:@[readAction, deleteAction] forContext:UIUserNotificationActionContextMinimal]; 

NSSet *categories = [NSSet setWithObject:messageCategory]; 

UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; 
UIUserNotificationSettings *mySettings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; 

[[UIApplication sharedApplication] registerForRemoteNotifications]; 
[[UIApplication sharedApplication] registerUserNotificationSettings:mySettings]; 

}

============== =============================

А вот часть крешлогам

Exception Type: SIGABRT 
Exception Codes: #0 at 0x396631f0 
Crashed Thread: 0 

Application Specific Information: 
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]' 

Application Specific Backtrace 1: 
0 CoreFoundation      0x2e91bf0b <redacted> + 130 
1 libobjc.A.dylib      0x390aece7 _objc_exception_throw + 38 
2 CoreFoundation      0x2e8552eb -[__NSPlaceholderArray initWithObjects:count:] + 418 
3 CoreFoundation      0x2e85ec61 +[NSArray arrayWithObjects:count:] + 44 
4 RunnerXiOS       0x000b6a83 -[AppController setupForPushNotifications] + 482 
5 RunnerXiOS       0x000b5a57 -[AppController application:didFinishLaunchingWithOptions:] + 1222 
6 UIKit        0x311bacc1 <redacted> + 276 
7 UIKit        0x311ba613 <redacted> + 1610 
8 UIKit        0x311b4cc9 <redacted> + 720 
9 UIKit        0x31150c97 <redacted> + 3550 
10 UIKit        0x3114fdf9 <redacted> + 72 
11 UIKit        0x311b4405 <redacted> + 616 
12 GraphicsServices     0x337adb55 <redacted> + 608 
13 GraphicsServices     0x337ad73f <redacted> + 34 
14 CoreFoundation      0x2e8e6847 <redacted> + 34 
15 CoreFoundation      0x2e8e67e3 <redacted> + 346 
16 CoreFoundation      0x2e8e4faf <redacted> + 1406 
17 CoreFoundation      0x2e84f769 _CFRunLoopRunSpecific + 524 
18 CoreFoundation      0x2e84f54b _CFRunLoopRunInMode + 106 
19 UIKit        0x311b362b <redacted> + 762 
20 UIKit        0x311ae891 _UIApplicationMain + 1136 
21 RunnerXiOS       0x000cf627 -[CCAtlasNode setQuadsToDraw:] + 90 
22 RunnerXiOS       0x00072218 __mh_execute_header + 21016 
+0

Являются ли какие-либо устройства iOS <8? – ahwulf

+0

Похоже, он говорит вам, что 'readAction' -' nil'. –

+0

Да, думаю, это может быть связано с версией ios? – Monty

ответ

1

Работы по интерактивным уведомлениям от IOS 8.0

Смежные вопросы