iphone - Passing movie title to a detail view in ios -


i able parse json file tableview can't figure out how movie title , pass detail view title. below methods

- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     static nsstring *cellidentifier = @"moviecell";      moviecell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath];      id video = [self.model.videos objectatindex:indexpath.row];     nsstring *rl = [video objectforkey:@"release_date"];     nsstring *imageurl;     if ([[video objectforkey:@"poster_path"] class] != [nsnull class])         imageurl = [video objectforkey:@"poster_path"];     else         imageurl = @"icon.jpg";      if (rl != (nsstring *)[nsnull null]){             nsstring *datestr = rl;             // convert string date object             nsdateformatter *dateformat = [[nsdateformatter alloc] init];             [dateformat setdateformat:@"yyyy-mm-dd"];             nsdate *date = [dateformat datefromstring:datestr];              // convert date object desired output format             [dateformat setdateformat:@"mm/yyyy"];             nsstring *released = @"released: ";             nsstring *fulldate;             datestr = [dateformat stringfromdate:date];             fulldate = [nsstring stringwithformat:@"%@ %@", released, datestr];             cell.videodescriptionlabel.text = fulldate;     }     else{         cell.videodescriptionlabel.text = @"n/a";     }     cell.videotitlelabel.text = [video objectforkey:@"title"];           nsstring* thumbnailurl = [nsstring stringwithformat:@"http://cf2.imgobject.com/t/p/w154%@",imageurl];     [cell.videothumbnail setimagewithurl:[nsurl urlwithstring:thumbnailurl] placeholderimage:[uiimage imagenamed:@"icon"]];     return cell; }  #pragma mark - table view delegate  - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil];     detailviewcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier:@"boot"];     [self.navigationcontroller pushviewcontroller:vc animated:yes];  } 

id video = [self.model.videos objectatindex:indexpath.row]; vc.title = [video objectforkey:@"title"]; 

btw, shouldn't use id type of video above.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -