ios - App crashes on scrolling when trying to use UITableViewDataSource -
just playing around sample code , hit on unexpected problem uitableviewdatasource.
my test app basic "navigation bar" iphone template, display list. i've added nsobject subclass implement uitableviewdatasource, embedded class rootviewcontroller.xib , connected tableview's datasource outlet.
the app starts ok. datasource gets initialised , table view populated first 10 rows. log:
2011-05-11 10:20:03.367 justalist[10562:207] jalmainviewdatasource init 2011-05-11 10:20:03.375 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.378 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.380 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.381 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.383 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.384 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.384 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.385 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.385 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730> 2011-05-11 10:20:03.386 justalist[10562:207] cellforrowatindexpath <jalmainviewdatasource: 0x5d23730>
soon scroll (ie. new cell required) app crashes:
2011-05-11 10:20:06.249 justalist[10562:207] -[__nscftimer tableview:cellforrowatindexpath:]: unrecognized selector sent instance 0x5d23730 2011-05-11 10:20:06.379 justalist[10562:207] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscftimer tableview:cellforrowatindexpath:]: unrecognized selector sent instance 0x5d23730'
it's called cellforrowatindexpath 10 times in row without problem, says unrecognized selector?
has maybe got sth way i'm initialising (ie. implicitly nib)? perhaps it's being prematurely released? hmm.. have ideas check out, wanted post question here first before wasting time (i intended try out sth different, wasn't anticipating problem!).
hope can help? cheers!
i solved myself (see own comment).
thanks reminder 'idz'. unable set answered - if remember correctly s.o. said had wait 24hrs before setting question answered.
Comments
Post a Comment