0

is there any possibility of passing some another view instead of the self .??

self.tableViewControl.dataSource =self; self.tableViewControl.delegate=self;

i tried this :

thirdView *tv=[[thirdView alloc]init];


 self.tableViewControl.dataSource =tv;
self.tableViewControl.delegate=tv;

and i have put the cellForRowAtIndexPath and all those reqired function in thirdView.m file but the app crashes .

iam a newbie to ios .

warzone_fz
  • 472
  • 1
  • 9
  • 24

1 Answers1

1

Make sure that the thirdView class implements the UITableView's delegate and datasource protocols, especially the ones that are @required.

EDIT:

Is the compiler giving some warning saying UITableViewDataSource not implemented? U have to implement the uitableview's datasource and delegate methods in the thirdview's .m implementation..Ur Table view is looking for the datasource in the thirdview's object and not able to find, so its a crash.

Ishank
  • 2,860
  • 32
  • 43
  • yes. i have done this in thirView :@interface thirdView : UIViewController – warzone_fz Feb 11 '13 at 06:12
  • and, their implementation in the thirdView.m? can u show the code/warnings? – Ishank Feb 11 '13 at 06:26
  • no i haven't implemented in thirdView .i just done this in the helloworldview.m thirdView *tv=[[thirdView alloc]init];self.tableViewControl.dataSource =tv; self.tableViewControl.delegate=tv; – warzone_fz Feb 11 '13 at 06:40