我正在尝试从数组中获取一些数据并将其打印在 Xcode 中的 UILabel 上,但我收到警告:
从“NSArray *”分配给“NSString *”的不兼容指针类型
这是我的代码:
NSError *myError = nil;
NSDictionary *res = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:&myError];
NSArray *results = [res objectForKey:@"current_observation"];
NSArray *cur = [results valueForKey:@"weather"];
NSArray *tmp = [results valueForKey:@"temp_c"];
NSLog(@"Current conditions: %@, %@º", cur, tmp);
temp.text = (@"%@", tmp);