Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing images from website in UITableView
    text
    copied!<p>I am trying to parse images into a UITableViewCell through a website. I can easily parse one image, but I am trying parse different multiple images.I have some ideas on how I would accomplish this, but I was wondering what will be the simplest and best way to perform such a task.I doubt this helps, but the icon.jpg are named like this 1_icon,2_icon ect... Any tips will be greatly appreciated.</p> <pre><code> - (void)viewDidLoad { mydata = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://example.com/uploads/1_icon.jpg"]]; myimage = [[UIImage alloc] initWithData:mydata]; _imageToDisplay.image=myimage; self.tableview.delegate = self; self.tableview.dataSource = self; [super viewDidLoad]; // Do any additional setup after loading the view. } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } cell.accessoryView = [[UIImageView alloc] initWithImage:myimage]; return cell; } </code></pre> <p>updated.m</p> <pre><code> _imagesArray = [[NSMutableArray alloc] init]; int numberOfIcons=30; for(int i = 1; i &lt;= numberOfIcons; i++){ [_imagesArray addObject:[[UIImage alloc] initWithData:[[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://example.com/uploads/%d_icon.jpg", i]]]]]; NSLog(@"%d",numberOfIcons); </code></pre> <p>updated .h</p> <pre><code> NSMutableArray *_imagesArray; NSArray*array; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload