the numberOfRowsInSection returns 0 when i press navigation controller's back button, but - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath is called when i put break point...application crashes ..any help please?
A:
Try to make the numberOfRowsInSection method return 1
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
MrThys
2009-12-18 10:06:13
i tried it.. it did not work....
Mikhail Naimy
2009-12-18 10:36:55
Can you show the code of your UITableViewDelegate?
MrThys
2009-12-18 11:02:02
A:
you should set the delegate of tableview to nil, dealloc before releasing your table view like this:
- (void)dealloc{
[myTableView setDelegate:nil];
[myTableView release];
myTableView = nil;
}
besides are you trying to reload the table in viewWillDisappear
, if yes you should avoid it and find a workaround for this.
Hope this helps.
Madhup
2009-12-18 12:08:24