How to change it back from activity indicator to disclosure in UITableViewCell after pushViewController
How to change it back from activity indicator to disclosure ??
the problem is:
When i didSelectRow, i made disclosure to activity indicator because it will load some picture for the next view controller and It's worked, but i dont have any luck to change it back to disclosure after pushViewController. i already tried to reload the table from the 2ndViewController but it's crashed.
So anybody have a solution for this problem..
Thanks in advance
This is my code in didSelectRow :
-(void)threadStartAnimating:(id)data
{
[activityView startAnimating];
[self.navigationController pushViewController:bdvController animated:YES];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[cell setAccessoryView:activityView];
[NSThread detachNewThrea开发者_开发问答dSelector:@selector(threadStartAnimating:) toTarget:self withObject:nil];
// Navigation logic -- create and push a new view controller
if(bdvController == nil)
bdvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row];
bdvController.appsRecord = appRecord;
bdvController.HeaderText.text = appRecord.appName;
bdvController.title = appRecord.artist;
[bdvController.tableView reloadData];
}
The best way is to set pointer nil to the accessoryView, example:
cell.accessoryView = nil;
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.selectionStyle = UITableViewCellSelectionStyleGray;
In my code these operations work fine.
精彩评论