ios - My table view is loading the detail view in a dark screen -


so have table view hooked plist urls. when click on table view cells want take me detail view, problem right when click on cell take me detail view loads dark screen nothing on it. don't receive errors on compiler have no idea wrong. have reset stimulator , tried restarting computer i'm starting think there wrong code. can help?

tableviewcontroller.m

    - (void)viewdidload {     [super viewdidload];  nsstring *mylistpath = [[nsbundle mainbundle] pathforresource:@"mylist" oftype:@"plist"]; tabledata = [[nsarray alloc]initwithcontentsoffile:mylistpath]; nslog(@"%@",tabledata);  }     - (nsinteger)numberofsectionsintableview:(uitableview *)tableview {   return [tabledata count];  }        - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {      // return number of rows in section.     return [tabledata count]; }          - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"cell"];      if( cell == nil )     {         nslog(@"cell creation");         cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:@"cell"];     }      //set data each cell     cell.textlabel.text = [[tabledata objectatindex:indexpath.row]objectforkey:@"cellname"];     cell.detailtextlabel.text = [[tabledata objectatindex:indexpath.row]objectforkey:@"cellsubtitle"];     cell.accessorytype = uitableviewcellaccessorydisclosureindicator;      return cell; }         - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     nslog(@"index selected,%d",indexpath.row);      webviewcontroller *view = [[webviewcontroller alloc] init];      nsstring *urltopass = [nsstring stringwithstring:[[tabledata objectatindex:indexpath.row]objectforkey:@"cellsubtitle"]];      view.urlstring = [[nsstring alloc] initwithformat:@"http://%@",urltopass];     view.modaltransitionstyle = uimodaltransitionstylecrossdissolve;      [self presentviewcontroller:view animated:yes completion:nil]; } 

when make controller in storyboard, need instance of view controller using instantiateviewcontrollerwithidentifier:, not using alloc init.

webviewcontroller *view = [self.storyboard instantiateviewcontrollerwithidentifier:@"webview"]; 

in storyboard, need give controller identifier "webview".


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -