Guest User

Untitled

a guest
Aug 15th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. NSMutableArray isn't adding all items, just the last one - Iphone / IOS / xcode
  2. NSArray *iconItems = [doc nodesForXPath:kName_icon error:nil];//Root node
  3. for (CXMLElement *iconItem in iconItems)
  4. {
  5.  
  6. NSArray *iconTempArray = [iconItem elementsForName:kName_url];
  7. for(CXMLElement *urlTemp in iconTempArray)
  8. {
  9. arryTableAllIcons = [[NSMutableArray alloc] init];
  10. [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
  11.  
  12. NSLog(@"Icon Found %@",urlTemp.stringValue);
  13.  
  14. break;
  15. }
  16.  
  17. cell.textLabel.text = [arryTableAllIcons objectAtIndex:indexPath.row];
  18.  
  19. The count is just: `return [arryTableAllIcons count];`
  20.  
  21. 2011-11-07 10:30:23.692 Del Search[2791:f203] Icon Found guideDogs_off.png
  22. 2011-11-07 10:30:23.692 Del Search[2791:f203] Icon Found WheelchairAssist_off.png
  23. 2011-11-07 10:30:23.739 Del Search[2791:f203] Icon Found walk_off.png
  24. 2011-11-07 10:30:23.740 Del Search[2791:f203] Icon Found DisabledWc_off.png
  25. 2011-11-07 10:30:23.741 Del Search[2791:f203] Icon Found hearingaid_off.png
  26. 2011-11-07 10:30:23.741 Del Search[2791:f203] Icon Found loop_off.png
  27. 2011-11-07 10:30:23.742 Del Search[2791:f203] Icon Found carpark_off.png
  28. 2011-11-07 10:30:23.742 Del Search[2791:f203] Icon Found dropcounter_off.png
  29. 2011-11-07 10:30:23.743 Del Search[2791:f203] Icon Found staff_off.png
  30. 2011-11-07 10:30:23.743 Del Search[2791:f203] Icon Found Buggy_off.png
  31.  
  32. for(CXMLElement *urlTemp in iconTempArray)
  33. {
  34. arryTableAllIcons = [[NSMutableArray alloc] init];
  35. [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
  36.  
  37. NSLog(@"Icon Found %@",urlTemp.stringValue);
  38.  
  39. break;
  40. }
  41.  
  42. for(CXMLElement *urlTemp in iconTempArray)
  43. {
  44. if (!arryTableAllIcons)
  45. arryTableAllIcons = [[NSMutableArray alloc] init];
  46. [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
  47.  
  48. NSLog(@"Icon Found %@",urlTemp.stringValue);
  49.  
  50. break;
  51. }
  52.  
  53. for(CXMLElement *urlTemp in iconTempArray)
  54. {
  55. if (!arryTableAllIcons)
  56. arryTableAllIcons = [[NSMutableArray alloc] init];
  57. [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
  58.  
  59. NSLog(@"Icon Found %@",urlTemp.stringValue);
  60. }
  61.  
  62. for(CXMLElement *urlTemp in iconTempArray)
  63. {
  64. arryTableAllIcons = [[NSMutableArray alloc] init];
  65. [arryTableAllIcons addObject:[NSString stringWithFormat:@"%@", urlTemp.stringValue]];
  66. NSLog(@"Icon Found %@",urlTemp.stringValue);
  67. break;
  68. }
Add Comment
Please, Sign In to add comment