0

I am using two UIDatepicker in my project. When I create second DatePicker, then I face problem in setting date on the second.

This is archive of my project with two DatePickers.
Where is problem?

Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
twox
  • 1
  • 1
  • I've run the app, but can't clearly see the problem. Can you describe your problem more in depth, and ideally post **some** relevant code here so others can take an easy look? Thanks. – WDUK Apr 29 '13 at 20:33
  • After open and close ContactCardView, the DatePicker on FirstViewController not work normal. When you change day or month, year will auto change on one. Button "Today" not workin correctly. I was forgot to say, that problem only on iOS 6.0 and 6.1 – twox Apr 30 '13 at 12:51

2 Answers2

0

You don't have the outlet connected in the ContactCardView.xib file. So effectively your datePickerBD is nil.

crackity_jones
  • 1,077
  • 2
  • 13
  • 16
  • The problem not in ContactCardView.xib, this form only for create second instance UIDatePicker. Problem with DatePicker on FirstViewController. After open and close ContactCardView, the DatePicker on FirstViewController not work normal. When you change day or month, year will auto change on one. Button "Today" not workin correctly. THIS IS ALL ONLY ON iOS 6.0 AND 6.1 – twox Apr 30 '13 at 12:48
  • I can't reproduce what you're indicating. – crackity_jones May 02 '13 at 15:51
  • Try: 1) Run project on Emulator 6.1 (or 6.0) 2) Press button 3) Close opend form with DatePicker 4) Try to change a day or month in the DatePicker on the FirstViewController. – twox May 03 '13 at 17:35
  • I re-downloaded your project and it had changed, which made your instructions make more sense. However I didn't have any problems changing the date picker in step 4 on the initial view. – crackity_jones May 03 '13 at 23:05
  • I did write down the screen video for this project: [test123.mov](http://vd-soft.biz/test123.mov) – twox May 06 '13 at 05:57
0

I found interesting bug in an UIDatePicker in line with setTimeZone in FirstViewController.m:

- (void)viewDidLoad
{   
    [super viewDidLoad];
    datePicker.locale = [NSLocale currentLocale];
    [datePicker setDatePickerMode: UIDatePickerModeDate];
    [datePicker setTimeZone: [NSTimeZone timeZoneWithAbbreviation:@"GMT"]];  // This line make strange effect on DatePicker with  create second instance one
}

If delete last operator, bug disappear!

twox
  • 1
  • 1