Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableArray isn't adding all items, just the last one - Iphone / IOS / xcode
- NSArray *iconItems = [doc nodesForXPath:kName_icon error:nil];//Root node
- for (CXMLElement *iconItem in iconItems)
- {
- NSArray *iconTempArray = [iconItem elementsForName:kName_url];
- for(CXMLElement *urlTemp in iconTempArray)
- {
- arryTableAllIcons = [[NSMutableArray alloc] init];
- [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
- NSLog(@"Icon Found %@",urlTemp.stringValue);
- break;
- }
- cell.textLabel.text = [arryTableAllIcons objectAtIndex:indexPath.row];
- The count is just: `return [arryTableAllIcons count];`
- 2011-11-07 10:30:23.692 Del Search[2791:f203] Icon Found guideDogs_off.png
- 2011-11-07 10:30:23.692 Del Search[2791:f203] Icon Found WheelchairAssist_off.png
- 2011-11-07 10:30:23.739 Del Search[2791:f203] Icon Found walk_off.png
- 2011-11-07 10:30:23.740 Del Search[2791:f203] Icon Found DisabledWc_off.png
- 2011-11-07 10:30:23.741 Del Search[2791:f203] Icon Found hearingaid_off.png
- 2011-11-07 10:30:23.741 Del Search[2791:f203] Icon Found loop_off.png
- 2011-11-07 10:30:23.742 Del Search[2791:f203] Icon Found carpark_off.png
- 2011-11-07 10:30:23.742 Del Search[2791:f203] Icon Found dropcounter_off.png
- 2011-11-07 10:30:23.743 Del Search[2791:f203] Icon Found staff_off.png
- 2011-11-07 10:30:23.743 Del Search[2791:f203] Icon Found Buggy_off.png
- for(CXMLElement *urlTemp in iconTempArray)
- {
- arryTableAllIcons = [[NSMutableArray alloc] init];
- [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
- NSLog(@"Icon Found %@",urlTemp.stringValue);
- break;
- }
- for(CXMLElement *urlTemp in iconTempArray)
- {
- if (!arryTableAllIcons)
- arryTableAllIcons = [[NSMutableArray alloc] init];
- [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
- NSLog(@"Icon Found %@",urlTemp.stringValue);
- break;
- }
- for(CXMLElement *urlTemp in iconTempArray)
- {
- if (!arryTableAllIcons)
- arryTableAllIcons = [[NSMutableArray alloc] init];
- [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
- NSLog(@"Icon Found %@",urlTemp.stringValue);
- }
- for(CXMLElement *urlTemp in iconTempArray)
- {
- arryTableAllIcons = [[NSMutableArray alloc] init];
- [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
- NSLog(@"Icon Found %@",urlTemp.stringValue);
- break;
- }
Add Comment
Please, Sign In to add comment