i was trying to animate the UIActivityindicator at didSelectRowAtIndexPath i.e when row is selected it should start animating until other view is not loaded. i was trying code but it does nothing, help!!!
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self. indicator stopAnimating];
if(bdvController == nil)
bdvController = [[BookDetailViewController alloc] initWithNibName:@"BookDetailView" bundle:[NSBundle mainBundle]];
if(indexPath.section == 0)
{
Book *aBook = [appDelegate.books objectAtIndex:indexPath.row];
bdvController.aBook = aBook;
}
else if(indexPath.section == 1)
{
Book *aBook = [appDelegate.books objectAtIndex:indexPath.row+5*indexPath.section];
bdvController.aBook = aBook;
}
[self.navigationController pushViewController:bdvController animated:YES];
}
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self.indicator startAnimating];
return indexPath;
}
Firstly
[self.indicator.startAnimating]; what are you trying to do on this line ? Are you accessing a property or calling a method .
And I think it will wait for the didSelectRow method completion to display the indiacator . May be you can try displaying the indicator in
and do the processing in
As you have not pasted code related to indicator creation. Hope you have set the selection style of the table view cell to UITableViewCellSelectionStyleNone and have also set the appropriate frame for indicator view .