Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableDictionary *returnedData = [NSJSONSerialization JSONObjectWithData:weatherData options:kNilOptions error:&error];
- NSMutableArray *array = [returnedData objectForKey:@"weather"];
- NSLog(@"%d", [array count]) //в логе пишет 4 объекта
- NSString *weatherCondition = [array objectAtIndex:3]; //вылетает с ошибкой
- 2017-01-15 13:54:32.616 weatherParser[992:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFArray objectAtIndex:]: index (3) beyond bounds (1)'
- *** First throw call stack:
- (0x3096bf83 0x3b11cccf 0x3096bec5 0x308b674b 0x3412f 0x3318d4ab 0x3318d269 0x33193eb9 0x33191827 0x331fb33d 0x331f7fad 0x331f256b 0x3318e6e9 0x3318d851 0x331f1ca9 0x357a6aed 0x357a66d7 0x30936a67 0x30936a03 0x309351d7 0x3089febf 0x3089fca3 0x331f0ed1 0x331ec14d 0x34607 0x3b629ab7)
- libc++abi.dylib: terminating with uncaught exception of type NSException
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement