iOS崩溃:'基金会_NSXPCSerializationAddData'

时间:2017-01-10 07:35:24

标签: ios crash twitter-fabric

我在Foundation的_NSXPCSerializationAddData方法中遇到了一个奇怪的EXC_BAD_ACCESS崩溃。它经常发生,但我无法从堆栈跟踪中获得任何有意义的信息。

唯一提示是崩溃发生在com.apple.UNSNotificationSchedulerConnection线程内,但我不知道它是什么。我使用本地通知提醒用户,此崩溃与NSLocalNotification有关吗?有人可以帮忙吗?

来自Crashlytics的Stacktrace:

Crashed: com.apple.UNSNotificationSchedulerConnection
0  libsystem_platform.dylib       0x2491e164 _platform_memmove$VARIANT$CortexA9 + 40
1  Foundation                     0x25351825 _NSXPCSerializationAddData + 156
2  Foundation                     0x25351825 _NSXPCSerializationAddData + 156
3  UIKit                          0x297f78f3 -[UIConcreteLocalNotification encodeWithCoder:] + 526
4  Foundation                     0x253418b7 -[NSXPCEncoder _encodeObject:] + 618
5  Foundation                     0x253a2d83 -[NSXPCEncoder _encodeArrayOfObjects:forKey:] + 210
6  Foundation                     0x253418b7 -[NSXPCEncoder _encodeObject:] + 618
7  Foundation                     0x25341ceb encodeInvocationArguments + 306
8  Foundation                     0x25341a47 -[NSXPCEncoder encodeInvocation:] + 362
9  Foundation                     0x253418b7 -[NSXPCEncoder _encodeObject:] + 618
10 Foundation                     0x254ecb0f -[NSXPCConnection _sendInvocation:withProxy:remoteInterface:withErrorHandler:timeout:userInfo:] + 2158
11 Foundation                     0x254ec22b -[NSXPCConnection _sendInvocation:withProxy:remoteInterface:] + 46
12 Foundation                     0x25340c47 -[_NSXPCDistantObject forwardInvocation:] + 82
13 CoreFoundation                 0x24bf2d83 ___forwarding___ + 350
14 CoreFoundation                 0x24b1e238 _CF_forwarding_prep_0 + 24
15 UserNotificationServices       0x262a1c67 __107-[UNSNotificationSchedulerConnection cancelScheduledLocalNotifications:forBundleIdentifier:withCompletion:]_block_invoke + 62
16 libdispatch.dylib              0x2475d823 _dispatch_call_block_and_release + 10
17 libdispatch.dylib              0x2476a423 _dispatch_queue_drain$VARIANT$mp + 1758
18 libdispatch.dylib              0x24769a61 _dispatch_queue_invoke$VARIANT$mp + 284
19 libdispatch.dylib              0x2476c5e9 _dispatch_root_queue_drain + 1560
20 libdispatch.dylib              0x2476bfcd _dispatch_worker_thread3 + 96
21 libsystem_pthread.dylib        0x24921b29 _pthread_wqthread + 1024
22 libsystem_pthread.dylib        0x24921718 start_wqthread + 8

请找到安排通知的代码,

//Appdelgate.h file
@property (strong, nonatomic) UILocalNotification *alarm;

//AppDelegate.m file
self.alarm = [[UILocalNotification alloc] init];
self.alarm.timeZone = [NSTimeZone defaultTimeZone];
self.alarm.soundName = UILocalNotificationDefaultSoundName;

//MainController.m file
[AppDelegate application].alarm.fireDate = alarmDueTime;
NSDictionary *userInfoDictionary = @ {
                    @"id" :@1
                };
[AppDelegate application].alarm.userInfo = userInfoDictionary;
[AppDelegate application].alarm.alertBody = localNotificationMessage;
[[UIApplication sharedApplication] scheduleLocalNotification:[AppDelegate application].alarm];

0 个答案:

没有答案