how to put elements of NSMutableArray in NSURL?

415 views Asked by At

Possible Duplicate:
Load image to a tableView from URL iphone sdk

How can I put the elements of the NSMutableArray in a urls of images?

NSMutableArray is created in the ViewDidLoad function. I am sure, that everything is OK with this array, because I NSLog it and it is fine.

I also tried to something like this

NSString* myString;
myString = [data separatedWithString:@" , "];

and then init the urls of the images with these string.

Thank you in advance!!!

here is the part of the code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *cellID = @"LinkID";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];

        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        }

        NSData *n = [self.data objectAtIndex:indexPath.row];


        NSURL *someUrl = here I have to put the url of the images


        [cell.imageView setImageWithURL:someUrl placeholderImage:[UIImage imageNamed:@"placeholder"]];

        cell.textLabel.text = [n description];

        return cell;

    }
1

There are 1 answers

5
hd1 On

Try this:

NSEnumerator* e = [arrayInstance objectEnumerator];
NSURL *someUrl;
while (someUrl = [e nextObject]) {
   // do your thing here with someUrl
}