Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

UIDatePicker doesn't snap to values in Cocos2d

I've got a problem with a UIDatePicker, using IOS 5 on iPad 1

The problem is that the day/month/year values don't 'snap' to the nearest value when scrolling. As a result the datepicker barrels stop in between values and the UIControlEventValueChanged doesn't fire.
If I fiddle with the picker long enough, it eventually picks the value and fires UIControlEventValueChanged, but then all barrels need to be spot on the value.

I've got the UIDatePicker placed in view in Cocos2d with the following code:

    CountDownCardsAppDelegate *thisApp = (CountDownCardsAppDelegate *) [[UIApplication sharedApplication] delegate];
UIWindow *window = [thisApp getWindow];

dateEntry = [[UIDatePicker alloc] init];
dateEntry addTarget:self action:@selector(dateChanged:) forControlEvents:UIControlEventValueChanged];

[dateEntry setDatePickerMode:UIDatePickerModeDate];

NSDate *today = [NSDate date];
[dateEntry setMinimumDate:today];
[window addSubview:dateEntry];



I can't seem to find this particular problem anywhere in the forums, neither as an IOS 5 bug, nor as a known Cocos2d issue with UIDatePicker.

Additional info:
- The function setDate:animated: doesn't seem to work either (but hard to test since it's hard to set a date in the first place)
- This only seems to happen on iPad 1 with IOS 5, other devices work fine and the simulator with IOS 5 is also fine.
- I built the app in an older version of Xcode (Snow Leopard), then transfered it to Xcode Lion.
- I tried settings like calender and timezone etc. but no effect.


So has anyone seen this problem before and if so does anyone have any suggestions to what it might cause it?
Post edited by JJ2Test on

Replies

  • JJ2TestJJ2Test Posts: 2New Users
    macbookflasher;437055 said:
    Last month I got the same problem, Tried alot to recover it but it never works. one of my friend told me to contact with apple support and they asked me to send them images of the errors. I sent them, they told me to go top apple store I went there and they restored.
    Thanx for the reply macbookflasher.

    What did you need to restore, the version of XCode, or the IOS 5 version on your device?
Sign In or Register to comment.