Advertisement
Guest User

Untitled

a guest
Jan 15th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NSMutableDictionary *returnedData = [NSJSONSerialization JSONObjectWithData:weatherData options:kNilOptions error:&error];
  2. NSMutableArray *array = [returnedData objectForKey:@"weather"];
  3. NSLog(@"%d", [array count]) //в логе пишет 4 объекта
  4. NSString *weatherCondition = [array objectAtIndex:3]; //вылетает с ошибкой
  5.  
  6. 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)'
  7. *** First throw call stack:
  8. (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)
  9. libc++abi.dylib: terminating with uncaught exception of type NSException
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement