I have a NSMutableArray * nameCatalog
which contains pair of names
and urls(name, url)
.
If I display nameCatalog
in viewDidLoad
like this:
for (Catalogue *o in nameCatalog){
NSLog(@"Catalog: %@", o.url);
}
I get the following links, which is good:
Next I wanna put the NSMutableArray * nameCatalog
as content to a table.And I implement the following:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSURL *url=[NSURL URLWithString:[[nameCatalog objectAtIndex:indexPath.row] valueForKey:@"url"]];
NSLog(@"the clicked url:%@", url);
}
So when I click the first row of the table it will be displayed the first url....the second and so on.
When I click first row
it gets displayed this
which is correct.
When I click second row
it displays this:
which is also correct.
When I click the third row
it displays this:
(null)
which is WRONG!
Where I'm going wrong?
Has anything to do with the fact that the third link contains the french e
?
in the word coupé
.
IMPORTANT:
Above for simplisity and for make it clear for everyone I assumed that my NSMutableArray
contains only 3 urls.
In fact it contains much more, about 20 urls.And everything is going great except the urls that contain french e
.When I click those rows of the table NSLog
displays null
.
And I'm sure that my NSMutableArray
contains those links.Please tell me how to fix this?