ios - Using SDWebImage in my TableViewController -
ios - Using SDWebImage in my TableViewController -
good afternoon,
i'm trying utilize sdwebimage in project first time , @ origin though going easy it's not. that's why i'm asking help because it's not working in website , i'm lost that.
first of all, need sdwebimage because need load asynchronously images tableviewcontroller.
that's uitableview within tableviewcontroller:
#import "sdwebimage/uiimageview+webcache.h" ... - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cartablecell"; cartableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[cartableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } // configure cell... cell.makelabel.text = [[_jsonarray objectatindex:indexpath.row] valueforkey:@"id"]; cell.likes.text = [[_jsonarray objectatindex:indexpath.row] valueforkey:@"likes"]; cell.comments.text = [[_jsonarray objectatindex:indexpath.row] valueforkey:@"comments"]; cell.username.text = [[_jsonarray objectatindex:indexpath.row] valueforkey:@"username"]; cell.refuser.text = [[_jsonarray objectatindex:indexpath.row] valueforkey:@"user_ref"]; cell.modellabel.text = [[_jsonarray objectatindex:indexpath.row] valueforkey:@"user"]; nsurl * imageurl = [nsurl urlwithstring:[[_jsonarray objectatindex:indexpath.row] valueforkey:@"imagen"]]; nsdata * imagedata = [nsdata datawithcontentsofurl:imageurl]; uiimage * carphoto = [uiimage imagewithdata:imagedata]; cell.carimage.image = carphoto; nsurl * imageurl2 = [nsurl urlwithstring:[[_jsonarray objectatindex:indexpath.row] valueforkey:@"image"]]; nsdata * imagedata2 = [nsdata datawithcontentsofurl:imageurl2]; uiimage * carphoto2 = [uiimage imagewithdata:imagedata2]; cell.profileimage.image = carphoto2; // lines included sdwebimage website steps: // here utilize new provided setimagewithurl: method load web image [cell.carimage setimagewithurl:[nsurl urlwithstring:@"http://www.domain.com/path/to/image.jpg"] placeholderimage:[uiimage imagenamed:@"placeholder.png"]]; // end homecoming cell; }
i have included files sdwebimage downloaded github, when write new lines, next error:
cartableviewcontroller.m:82:21: no visible @interface 'uiimageview' declares selector 'setimagewithurl:placeholderimage:'
why happening , how can solve problem?
thanks in advance.
ios xcode uitableview xcode6 sdwebimage
Comments
Post a Comment