views:

162

answers:

1

So, idea is the following. I have UITableViewCell, and when I click on it, I want to show UIActivityIndicatorView right in this cell. I cannot figure out how do I find the X/Y or any position (I can find the frame size of UITableViewCell though but it does not help much :-) for the given cell. Any tips? Help?

Thank you!

+2  A: 

If you have the cell, just add the activity indicator to the cell's contentView as a subview. There's no need to know the cell's position in terms of the table view's coordinate system to position the activity indicator within the cell. If you don't have a reference to the cell, call your table view's cellForRowAtIndexPath: method.

Ole Begemann
This doesn't seem to work actually.This is what I am trying to do:UITableViewCell *cellView = [self tableView:tableView cellForRowAtIndexPath:indexPath];[cellView.contentView addSubview:cCellWaitView];// and cCellWaitView is defined in .h, initialized in viewDidLoad[NSThread detachNewThreadSelector: @selector(spinBegin) toTarget:self withObject:nil];// where spinBegin is bacially [cCellWaitView startAnimating];that's it -- and the problem is that nothing changes...
alexeypro
`[self tableView:tableView cellForRowAtIndexPath:indexPath]` (the datasource method) is not the same as `[tableView cellForRowAtIndexPath:indexPath]` (the method of UITableView).
Ole Begemann