Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zcarter

macrumors member
Original poster
Apr 21, 2007
46
0
Hello,

I'm trying to get a timer going. How can I tie in my UIDatePicker (on timer mode) to work with my NSTimer.

To start out with, whenever I connect a UIDatePicker in IB, it works fine, but the second I switch the mode to "Timer" my program crashes.

So I need help getting the instance to populate a UIDatePicker in TIMER mode and the connecting it to an NSTimer..

Can anyone help?

Thanks so much...

Zac
 

tyr2

macrumors 6502a
May 6, 2006
833
242
Leeds, UK
As I understand it you need to configure it so that UIControlEventValueChanged is handled by your code when the user changes the time.

This code should create or update an NSTimer that calls '- (void)setDate: (NSDate *)date animated: (BOOL)animated' on the date picker, the DatePicker doesn't link directly to an NSTimer object.

Is this what you're doing? Any errors when the app crashes or compile warnings?
 

zcarter

macrumors member
Original poster
Apr 21, 2007
46
0
That's what I'm trying to do yes...but it won't even populate an instance of the UIDatePicker...am I pissing additional code? It works fine if the "mode" of the UIDatePicker is anything except a "Timer"...but if I select the mode to be a timer..it crashes...so I guess I should start with the app not crashing when I load up, THEN worry about setting the timers...

- Zac
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.