the numberOfRowsInSection
returns 0 when i press navigationcontroller's
back button,
but - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(开发者_开发技巧NSIndexPath *)indexPath
is called when i put break point...application crashes ..any help please?
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.
Try to make the numberOfRowsInSection method return 1
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
精彩评论