0
我想在重新加載我的App後比較兩個字符串。 (strold和strnew聲明全局)- (void)applicationWillResignActive並保存字符串 - >錯誤
但如果我叫字符串 'strold' 在-applicationWillEnterForeground:我收到以下錯誤信息:
0x011eca62 < 0022>推%EDI
0x011eca63 < 0023> MOV位於0x8(%EDX),%EDI(BAD EXIT這一行)
- (void)applicationWillEnterForeground:(UIApplication *)application{
opendate = [NSDate date];
NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"yyyy-MM-dd"];
strnew = [formatter stringFromDate:opendate];
NSLog(@"Active %@",strnew);
NSLog(@"Inctive %@",strold);
}
- (void)applicationWillResignActive:(UIApplication *)application{
closedate = [NSDate date];
NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"yyyy-MM-dd"];
strold = [formatter stringFromDate:closedate];
}
我只想檢查一天實際上是否改變。 重要時間方法沒有爲我工作。
非常感謝。 – 2011-06-16 12:57:20