ios - NSString StringWithFormat returns nil? -
i created table view links user has saved. user can click on cell link , go direct webpage (view controller web view). however, link returns null in prepareforsegue
method , web view appears empty. stringwithformat
may need rewritten. block of code assigned when user clicks on link in table view.
tableview.m
-(void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring:@"showarticle"]) { nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; nsstring *urlstring = [nsstring stringwithformat:@"http://%@", _todoitems[indexpath.row]]; [[segue destinationviewcontroller] seturl:urlstring];
are sure array of items has items? should put breakpoint , print out value of todoitem @ indexpath. if not null create string format coding.
Comments
Post a Comment