NSURL has an absoluteString method that you can use like this
NSURL *imageURL = [NSURL URLWithString:dataList[indexPath.item][@"image"]]; NSString *urlString = [imageURL.absoluteString stringByReplacingOccurrencesOfString:@"image" withString:@"img"]; imageURL = [NSURL URLWithString:urlString];
You can also work directly with NSString from the data list:
NSString *urlString = [dataList[indexPath.item][@"image"] stringByReplacingOccurrencesOfString:@"image" withString:@"img"]; imageURL = [NSURL URLWithString:urlString];
source share