user2494343 user2494343 - 1 year ago 127
iOS Question

CFNetwork internal error when load multiple images from local JSON file into tableview

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *cellIdentifier = @"ChatCell";
ChatCell *cell = \[tableView dequeueReusableCellWithIdentifier:@"myCell"\];

if (cell == nil)
\[tableView registerNib:\[UINib nibWithNibName:cellIdentifier bundle:nil\] forCellReuseIdentifier:@"myCell"\];

cell = \[tableView dequeueReusableCellWithIdentifier:@"myCell"\];

ChatData *chatData = \[self.loadedChatData objectAtIndex:\[indexPath row\]\];

\[cell.images sd_setImageWithURL:\[NSURL URLWithString:@","\]placeholderImage:\[UIImage imageNamed:@"placeholder"\]\];
\[cell loadWithData:chatData\];

return cell;


Why am I getting a CFNetwork internal error when I try to load multiple images from a local json file into my tableview?

Answer Source

It is because that your url is not found on server, I mean your url (, is wrong. If I open this url in browser then it throws error 404 like The requested URL /AppPartnerProgrammerTest/images/justin_avatar.png, was not found on this server. You can try to open this url in browser. Otherwise your code seems to be alright. there is no problem with code i think!!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download