set date error on uidatepicker
- by Matt Facer
Hi guys,
I've been stumped by the code below. I pass a string date to a UIDatePicker which seems to work on most devices, yet on some, it crashes the app.
here's the code
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"HH:mm"];
NSDate *date = [dateFormat dateFromString:dateStr];
[timePicker setDate:date];
[dateFormat release];
I have a function which passes the "dateStr" variable, as follows, dateStr = @"0:0"; I cannot see what's wrong - as it works for me! (iphone 3.1.3) but it doesnt work for my tester (ipod touch 3.1.3)
Can anyone see anything wrong with the code?
Thanks v much.
any ideas?