iphone - UITableViewCell nil condition -


usually configure cell outside condition of cell nil. in case doing same convert nsdata image outside cell nil. that, every time fire request , reload table, convert data image particular cell perfectly. after reloading table, problem when scroll table, every time convert nsdata image obvious. need avoid conversion on scrolling after reloading table.

    static nsstring *cellidentifierimage =  @"cellidentifierimage"; if(indexpath.section == 0)     {         newsimagecell *newsimagecell = [tableview dequeuereusablecellwithidentifier:cellidentifierimage];          if (newsimagecell == nil)         {             nslog(@"cellnil");             newsimagecell = [[newsimagecell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifierimage];             newsimagecell.selectionstyle = uitableviewcellselectionstylenone;         }          if([[applicationdata sharedinstance].arrtop10newshome count]>0)         {             nsmutabledictionary *dicsource = [arrsource objectatindex:indexpath.row];             nsurl *urlimage = [nsurl urlwithstring:[dicsource retrieveforpath:@"itemimage"]];             newsimagecell.lblnewsheading.text = [dicsource objectforkey:@"title"];             [newsimagecell.loadingindicator startanimating];             dispatch_queue_t queue = dispatch_get_global_queue(dispatch_queue_priority_high, 0ul);             dispatch_async(queue, ^{                 uiimage *image = [uiimage imagewithdata:[nsdata datawithcontentsofurl:urlimage]];                 dispatch_sync(dispatch_get_main_queue(), ^{                     newsimagecell.imgvwnews.image = image;                     [newsimagecell.loadingindicator stopanimating];                 });             });         }          return newsimagecell;     } 

appreciate ideas in advance !!!

use egoimageview instead of uiimageview.

see demo project of egoimageview


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -