You just load an NSArray
inside viewDidLoad
. Inside cellForRowAtIndexPath:
you add the URL from your NSArray
and insert it into the UITableViewCell
.
static NSString *myIdentifier = @"CustomItem"
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:myIdentifier]
[cell.labelURL setText:_arrayURLs[indexPath.row]];
Everything you have to do is to add a new property to your CustomCell called labelURL and connect it with a UILabel
inside your UIStoryboard
or xib
file.
And think about, you can't just set them once. UITableViewCell
will reuse its UITableViewCells
and will always set another value multiple times to the same object. Thats why you have to do it this way and not only once.