I have an array, and I am trying to get an integer in my array into a int or NSInteger. It uses NSDictionaries. The following code does not work:
int color = [[records objectAtIndex:0] valueForKey: @"color"];
Note that I am using a Core Data Fetch that saves into an array called "records".
Thanks
尝试这个:
int color = [[[records objectAtIndex:0] valueForKey: @"color"] intValue];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.