NSTimer with userInfo

2009-05-12 Thread Eric E. Dolecki
*)tableView didSelectRowAtIndexPath:( NSIndexPath *)indexPath { UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath]; UILabel *cellLabel = (UILabel *)[newCell.contentView viewWithTag:1]; [newCell setSelected:YES animated:YES]; // What do I use for userInfo? [NSTimer

Re: NSTimer with userInfo

2009-05-12 Thread Eric E. Dolecki
. Dolecki edole...@gmail.com wrote: // What do I use for userInfo? [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector( onTimer) userInfo:nil repeats:NO]; ... any object you want. A dictionary? A row number wrapped in an NSNumber? A custom object

Re: NSTimer with userInfo

2009-05-12 Thread I. Savant
On Tue, May 12, 2009 at 10:21 AM, Eric E. Dolecki edole...@gmail.com wrote: Here are my 2 methods: - (void)onTimer { ... [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector( onTimer) userInfo:nil repeats:NO]; Ah. I see your confusion. Take another look at the

Re: NSTimer with userInfo

2009-05-12 Thread I. Savant
On Tue, May 12, 2009 at 10:21 AM, Eric E. Dolecki edole...@gmail.com wrote:        // What do I use for userInfo? [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector( onTimer) userInfo:nil repeats:NO]; ... any object you want. A dictionary? A row number wrapped

Re: NSTimer with userInfo

2009-05-12 Thread Eric E. Dolecki
Okay, so I have this... [NSTimer scheduledTimerWithTimeInterval:0.2 target:selfselector:@selector( onTimer:) userInfo:nil repeats:NO]; And then my selector looks like this: - (void)onTimer:(NSTimer *)timer { NSLog(@%@, [timer userInfo] ); } Now, all I might need to do is to somehow package

Re: NSTimer with userInfo

2009-05-12 Thread I. Savant
On Tue, May 12, 2009 at 10:39 AM, Eric E. Dolecki edole...@gmail.com wrote: Okay, so I have this... [NSTimer scheduledTimerWithTimeInterval:0.2 target:selfselector:@selector(onTimer:) userInfo:nil repeats:NO]; And then my selector looks like this: - (void)onTimer:(NSTimer *)timer {   

Re: NSTimer with userInfo

2009-05-12 Thread Graham Cox
On 13/05/2009, at 12:42 AM, I. Savant wrote: Now, all I might need to do is to somehow package up the tableView and the indexPath and stuff that into something and declare that as the userInfo? And what might that look like? It would look like my previous response suggested. Use those

Re: NSTimer with userInfo

2009-05-12 Thread I. Savant
On Tue, May 12, 2009 at 10:49 AM, Graham Cox graham@bigpond.com wrote: Normally the object receiving the timer callbacks is a controller that already knows about those objects, or has direct ways to get them. If not, you may have a design problem... I'd considered that in my response,

Re: NSTimer with userInfo

2009-05-12 Thread Eric E. Dolecki
This is how I have this implemented at the moment (thoughts?) However I'm not really seeing an animation to the selected state, it just kind of happens - (void)onTimer:(NSTimer *)timer { [[[timer userInfo] objectForKey:@table] deselectRowAtIndexPath:[[timer userInfo] objectForKey:@indexPath

Re: NSTimer with userInfo

2009-05-12 Thread Eric E. Dolecki
Actually, I just made a reference to the table here because that seems a lot cleaner and I'm not currently managing multiple tables. So I'll simply use that reference for now, however I am still including it with the indexPath in that dictionary I am sending just in case I want to change that in