Animate the initial selection of a cell in UITableView
Animate the initial selection of a cell in UITableView
- Subject: Animate the initial selection of a cell in UITableView
- From: "Eric E. Dolecki" <email@hidden>
- Date: Tue, 12 May 2009 12:57:43 -0400
I am animating the deselection of cell in a UITableView via
didSelectRowAtIndexPath (which works great), however the initial selection
I'd like to have animated to the selected state graphic I am using. Where
exactly should I set that up?
Here is my take on the selection & deselection:
- (void)onTimer:(NSTimer *)timer {
// Yes I know I am sending the tableView too, it's for potentially more
dynamic calls later
[table deselectRowAtIndexPath:[[timer userInfo] objectForKey:@"indexPath"]
animated:YES];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(
NSIndexPath *)indexPath {
UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
UILabel *cellLabel = (UILabel *)[newCell.contentView viewWithTag:1];
// THIS DOESN"T SEEM TO BE THE WAY TO DO IT - SET IT UP FIRST SOMEPLACE
ELSE?
[newCell setSelected:YES animated:YES];
NSMutableDictionary *myDictionary = [[NSMutableDictionary alloc] init];
[myDictionary setObject:tableView forKey:@"table"];
[myDictionary setObject:indexPath forKey:@"indexPath"];
[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(
onTimer:) userInfo:myDictionary repeats:NO];
[myDictionary release];
}
Thanks for any and all replies,
Eric
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden