每當我構建並運行時,我都不會收到錯誤或警告。然後我嘗試設置NSZombieEnabled
。我得到以下崩潰:在發送到釋放實例的消息時崩潰-dealloc
2011-12-06 16:08:46.869 APITextProject [4194:207] * - [APITextProjectViewController的dealloc]:消息發送到釋放實例0x5a31480
這裏是我的代碼:
#pragma ASI Delegate methods
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSLog(@"Request finished successfully");
NSLog(@"%@",[request responseString]);
NSDictionary *responseDictionary = [[request responseString]JSONValue];
NSDictionary *arrayElement = [responseDictionary objectForKey:@"user"];
NSString *ID = [arrayElement valueForKeyPath:@"id"];
NSLog(@"id: %d",ID);
NSString *usr = [arrayElement valueForKeyPath:@"usr"];
NSLog(@"usr: %@",usr);
NSString *gd = [arrayElement valueForKeyPath:@"gd"];
NSLog(@"gd: %@",gd);
NSString *age = [arrayElement valueForKeyPath:@"ag"];
NSLog(@"ag: %@",age);
NSString *st = [arrayElement valueForKeyPath:@"st"];
NSLog(@"st: %@",st);
NSString *lf = [arrayElement valueForKeyPath:@"lf"];
NSLog(@"lf: %@",lf);
NSString *da = [arrayElement valueForKeyPath:@"da"];
NSLog(@"da: %d",da);
for(NSString *value in [arrayElement allValues]){
NSLog(@"Found Value %@",value);
label.text = value;
[super release];
}
}
你崩潰是因爲APITextProjectViewController實例不正確使用,但你的代碼不顯示,你如何使用它 – Denis
你有沒有嘗試在'requestFinished:'方法中註釋'[super release];'? – Kjuly
感謝您立即回覆球員....我真的很感激它...感謝很多。 – NoobMe