2013-07-18 78 views
1
價值

我有這個堆棧跟蹤:崩潰NSUserDefaults的中設置

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!)。 任何人都可以幫助我嗎?

+0

看起來問題不是出在IOS版本。嘗試輸出所有參數。 – kaspartus

+0

此外,用於存儲關鍵的好的做法是: '#定義kMyKeyName @「myKeyName」' 然後: '... forKey:kMyKeyName' – kaspartus

+4

你可以嘗試建立無TestFlight - 它取代你的信號處理程序,這使得很難看出是什麼原因導致了原始信號。 – ipmcc

回答

1
  1. 是self.savedLogin零?
  2. 是self.savedLogin一個的NSString?
+0

讓我補充一點,是self.savedlogin屬性列表兼容的對象,並且它只包含屬性列表兼容的對象? –

+0

yeap,它只包含NSString對象,表示兼容plist。 – user2595925

+0

yeap。 self.savedLogin爲零。見上面爲什麼.. – user2595925