在NSUserDefaults中设置值时崩溃

时间:2013-07-18 14:30:09

标签: iphone ios objective-c

我有这个堆栈跟踪:

0 LiveTexOpClient 0x000b3d3a testflight_backtrace + 382
1 LiveTexOpClient 0x000b4988 TFSignalHandler + 264
2 libsystem_c.dylib 0x3c4d0e92 _sigtramp + 42
3 CoreFoundation 0x342edb4f CFBasicHashFindBucket + 1891
4 CoreFoundation 0x342edb4f CFBasicHashFindBucket + 1891
5 CoreFoundation 0x342eea8a CFDictionaryGetValue + 82
6 CoreFoundation 0x343357a6 -[CFXPreferencesPropertyListSource setValue:forKey:] + 38
7 CoreFoundation 0x34335722 _CFXPreferencesSetValue + 134
8 CoreFoundation 0x34335600 CFPreferencesSetAppValue + 40
9 Foundation 0x34c1c906 -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 82
10 LiveTexOpClient 0x0006db28 -[LTAuthorizationManager saveLatestSessionTimeStamp] (LTAuthorizationManager.m:390)
11 LiveTexOpClient 0x0002d7aa -[LTAppDelegate applicationWillResignActive:] (LTAppDelegate.m:48)
12 UIKit 0x36209fb4 -[UIApplication _deactivateForReason:notify:] + 400
13 UIKit 0x3623ff2a -[UIApplication _handleApplicationSuspend:eventInfo:] + 314
14 UIKit 0x361b61e6 -[UIApplication handleEvent:withNewEvent:] + 2458
15 UIKit 0x361b56cc -[UIApplication sendEvent:] + 72
16 UIKit 0x361b511a _UIApplicationHandleEvent + 6154
17 GraphicsServices 0x37eb85a2 _PurpleEventCallback + 590
18 GraphicsServices 0x37eb81d2 PurpleEventCallback + 34
19 CoreFoundation 0x34382172 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
20 CoreFoundation 0x34382116 __CFRunLoopDoSource1 + 138
21 CoreFoundation 0x34380f98 __CFRunLoopRun + 1384
22 CoreFoundation 0x342f3ebc CFRunLoopRunSpecific + 356
23 CoreFoundation 0x342f3d48 CFRunLoopRunInMode + 104
24 GraphicsServices 0x37eb72ea GSEventRunModal + 74
25 UIKit 0x36209300 UIApplicationMain + 1120
26 LiveTexOpClient 0x0002e144 main (main.m:14)
27 LiveTexOpClient 0x0002d28f start + 39

代码来自:

-(void)saveLatestSessionTimeStamp
{
    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]] forKey:self.savedLogin];
    [[NSUserDefaults standardUserDefaults] synchronize];
}

崩溃只发生在5个中的两个设备上。 它上了两个iphone(ios 6.1.3),但没有上另一个iphone(同样的ios 6.1.3!)。 有人可以帮帮我吗?

1 个答案:

答案 0 :(得分:1)

  1. self.savedLogin nil?
  2. 是self.saved登录NSString吗?