ios - Thread 1 : SIGABRT error in simple storyboard app -


i have made extremely simple app using storyboards (for first time).

the app's table view controller embedded in navigation controller , segues out view controller displays image. when click on row, gives me thread 1 sigabrt error. here's log :

2013-09-03 22:37:16.669 footballplayers[7226:c07] * terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: '-[uitableviewcontroller loadview] loaded "pcv-xw-t12-view-xx8-ac-4ru" nib didn't uitableview.' * first throw call stack: (0x1c94012 0x10d1e7e 0x1c93deb 0x245357 0xf6ff8 0xf7232 0xf74da 0x10e8e5 0x10e9cb 0x10ec76 0x10ed71 0x10f89b 0x10fe93 0xc4823f7 0x10fa88 0x46be63 0x45db99 0x45dc14 0xc5249 0xc54ed 0xacf5b3 0x1c53376 0x1c52e06 0x1c3aa82 0x1c39f44 0x1c39e1b 0x1bee7e3 0x1bee668 0x15ffc 0x226d 0x2195 0x1) libc++abi.dylib: terminate called throwing exception

here's implementation of tableviewcontroller

#import "playerstableviewcontroller.h"  @interface playerstableviewcontroller ()  @end  @implementation playerstableviewcontroller  nsmutablearray *players;  - (void) prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {     displayviewcontroller *dvc = [segue destinationviewcontroller];     nsindexpath *path = [[self tableview] indexpathforselectedrow];     [dvc setcurrentplayer:[players objectatindex:[path row]]];  }  - (id)initwithstyle:(uitableviewstyle)style {     self = [super initwithstyle:style];     if (self) {         // custom initialization     }     return self; }  - (void)viewdidload {     [super viewdidload];     players = [[nsmutablearray alloc] init];      player *stevengerrard = [[player alloc] init];     [stevengerrard setname:@"steven gerrard"];     [stevengerrard setfilename:@"steven gerrard.jpg"];     [stevengerrard setinformation:@"international team : england, club : liverpool fc"];     [players addobject:stevengerrard];      player *cristianoronaldo = [[player alloc] init];     [cristianoronaldo setname:@"cristiano ronaldo"];     [cristianoronaldo setfilename:@"cristiano ronaldo.jpg"];     [cristianoronaldo setinformation:@"international team : portugal, club : real madrid"];     [players addobject:cristianoronaldo];      // uncomment following line preserve selection between presentations.     // self.clearsselectiononviewwillappear = no;      // uncomment following line display edit button in navigation bar view controller.     // self.navigationitem.rightbarbuttonitem = self.editbuttonitem; }  - (void)didreceivememorywarning {     [super didreceivememorywarning];     // dispose of resources can recreated. }  #pragma mark - table view data source  - (nsinteger)numberofsectionsintableview:(uitableview *)tableview {     // return number of sections.     return 1; }  - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {     // return number of rows in section.     return [players count]; }  - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     static nsstring *cellidentifier = @"playercell";     uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath];      // configure cell...     player *current = [players objectatindex:[indexpath row]];     [[cell textlabel] settext:[current name]];      return cell; }  /* // override support conditional editing of table view. - (bool)tableview:(uitableview *)tableview caneditrowatindexpath:(nsindexpath *)indexpath {     // return no if not want specified item editable.     return yes; } */  /* // override support editing table view. - (void)tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath {     if (editingstyle == uitableviewcelleditingstyledelete) {         // delete row data source         [tableview deleterowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationfade];     }        else if (editingstyle == uitableviewcelleditingstyleinsert) {         // create new instance of appropriate class, insert array, , add new row table view     }    } */  /* // override support rearranging table view. - (void)tableview:(uitableview *)tableview moverowatindexpath:(nsindexpath *)fromindexpath toindexpath:(nsindexpath *)toindexpath { } */  /* // override support conditional rearranging of table view. - (bool)tableview:(uitableview *)tableview canmoverowatindexpath:(nsindexpath *)indexpath {     // return no if not want item re-orderable.     return yes; } */  #pragma mark - table view delegate  - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     // navigation logic may go here. create , push view controller.     /*      <#detailviewcontroller#> *detailviewcontroller = [[<#detailviewcontroller#> alloc] initwithnibname:@"<#nib name#>" bundle:nil];      // ...      // pass selected object new view controller.      [self.navigationcontroller pushviewcontroller:detailviewcontroller animated:yes];      */ }  @end 

what's wrong ?!

thank you.

one handy thing add exception breakpoint: https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html

this way you'll see exact place in code goes wrong.

if error occurs after tapping on row, code of destination view controller interesting.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -