-(void) httpDataDidFinishLoadingWithData:(NSData *)theData
{
m_activityLoaded=NO;
temp=[[NSString alloc] initWithData:[dataLoader httpData]
encoding:NSUTF8StringEncoding];
NSLog(@"TEMP IS TEMP %@", temp);
NSDictionary *dict = [[NSDictionary alloc]init];
dict = [[temp JSONValue] objectForKey:@"location"];
NSDictionary *dict1 = [[NSDictionary alloc]init];
dict1 = [[temp JSONValue] objectForKey:@"wind"];
NSDictionary *dict2 = [[NSDictionary alloc]init];
dict2 = [dict1 objectForKey:@"direction"];
NSDictionary *dict3 = [[NSDictionary alloc]init];
dict3 = [[temp JSONValue] objectForKey:@"atmosphere"];
NSDictionary *dict4 = [[NSDictionary alloc]init];
dict4 = [[temp JSONValue] objectForKey:@"condition"];
NSDictionary *dict5 = [[NSDictionary alloc]init];
dict5 = [dict4 objectForKey:@"text"];
NSDictionary *dict6 = [[NSDictionary alloc]init];
dict6 = [dict4 objectForKey:@"code"];
NSDictionary *dict7 = [[NSDictionary alloc]init];
dict7 = [dict4 objectForKey:@"temperature"];
temperatureLabel.text = [dict4 objectForKey:@"temperature"];
}
崩潰發生在temperatureLabel.text = [dict4 objectForKey:@"temperature"];
時的NSDictionary或NSString的值代入的UILabel
我不知道男人入門崩潰,數據精確地打印在控制檯中,但在的UILabel(temperatureLabel)崩潰。幫助我,在此先感謝
只是一個小提示,當你要給它分配一個其他的值時,不要分配和初始化'NSDictionary'。你現在只是泄漏記憶。 – rckoenes
我試圖仍然崩潰... – Joker
錯誤消息是[__NSCFNumber isEqualToString:]:無法識別的選擇發送到實例0x68ac960 – Joker