objective c - Terminating app due to uncaught exception 'NSRangeException'. [__NSArrayM objectAtIndex:]: index 33 beyond bounds [0 .. 32]' -
I have it I'm ImportViewControllerkm
I remove names from the XML server and load. Total number of elements is 33.
- (zero) viewDidoadload {[Super Viewedload]; Self.title = @ "Import"; NSLog (@ "user id =% @", current user id); // Some code to send HTTP request ............. NSString * str = [[NSString alloc] initWithData: urlData encoding: NSUTF8StringEncoding]; NSLog (@ "str response:% @", str); NSURL * fileURL = [[Ansuarel light] Intvithstring [unstar Stringbaadingperent Skepas Upyoging Encoding Anstif 8 string encoding]]; NSDTA * XMLData = [[NSMUtableDataAloc] Invite content of URL: file URL]; GDATXML Document * DOC = [[Gdataxml document ALOOC] DirectWhatAdata: XMLData option: 0 error: Nile]; NSArray * name = [doctor nodes forexpath: @ "// contact / contact / name / first name" error: zero]; (Element in GDataXMLElement * names) {// NSLog (@ "name:% @", element.stringValue); [Option addObject: element.stringValue]; } [Option addObject: @ "blue"]; NSLog (@ "Count:% U", [Option Count]); (CFIndex i = 0; i & lt; = [Option count]; i ++) {NSLog (@ "Option item% lu:% @ \ n", i, option [i]) for; }} Error: Exception exception to 'NSR Exchange Exception', reason: ' * - [__ NSAMM ObjectIndex:]: Index exceeded the limit of 33 [0] .. 32] '' * * first throw call stack:
your line
for For (cfinse i = 0; i count]; i ++)
Comments
Post a Comment