• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Animate the initial selection of a cell in UITableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Special requirements for the window param of NSAlert beginSheetModalForWindow?
  • Next by Date: interrupting a modified document save (as) invocation, security
  • Previous by thread: Re: Special requirements for the window param of NSAlert beginSheetModalForWindow?
  • Next by thread: interrupting a modified document save (as) invocation, security
  • Index(es):
    • Date
    • Thread