Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-16-2011, 11:45 PM   #1 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Smile UIDatepicker's blue "today" label not changing

Hey,

When the user might use an app w/ a date picker that shows date and time and then leave their device on overnight, the blue Today label in the date picker still stays on the previous day's date, not the new date.

Is there a way to clear the date picker and then send it a new date?

Code:
datepicker = nil; //I was thinking that this would reset the date picker settings
datePicker.date = [NSDate date];
^doesn't work, just sets the new time and date, but not the today label.
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-17-2011, 12:10 AM   #2 (permalink)
Beast Mode
 
Join Date: Dec 2008
Age: 21
Posts: 1,971
Bertrand21 is on a distinguished road
Default

Code:
[datePicker setDate:[NSDate date] animated:NO];
Also,
Maybe try changing the datePickerMode to "reload" the data.
__________________
Haters gonna Hate
Likers gonna Like

Last edited by Bertrand21; 05-17-2011 at 12:13 AM.
Bertrand21 is offline   Reply With Quote
Old 05-17-2011, 12:27 AM   #3 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

Quote:
Originally Posted by Bertrand21 View Post
Code:
[datePicker setDate:[NSDate date] animated:NO];
Also,
Maybe try changing the datePickerMode to "reload" the data.
setDate doesn't work, it just sets the date. How would I get it to reload?
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-17-2011, 12:32 AM   #4 (permalink)
Beast Mode
 
Join Date: Dec 2008
Age: 21
Posts: 1,971
Bertrand21 is on a distinguished road
Default

Quote:
Originally Posted by ansonl View Post
setDate doesn't work, it just sets the date. How would I get it to reload?
Also,
Maybe try changing the datePickerMode to "reload" the data.
__________________
Haters gonna Hate
Likers gonna Like
Bertrand21 is offline   Reply With Quote
Old 05-17-2011, 12:40 AM   #5 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

Hmm, doesn't seem to work, either. Still keeps the Today label on the previous date.

I guess removing the datepicker and recreating it would work, but another method would probably be much better.
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-17-2011, 12:43 AM   #6 (permalink)
Beast Mode
 
Join Date: Dec 2008
Age: 21
Posts: 1,971
Bertrand21 is on a distinguished road
Default

Quote:
Originally Posted by ansonl View Post
Hmm, doesn't seem to work, either. Still keeps the Today label on the previous date.

I guess removing the datepicker and recreating it would work, but another method would probably be much better.
So if you change it like so:

Code:
yourDatepicker.datePickerMode = UIDatePickerModeCountDownTimer;//Some random mode...
yourDatepicker.datePickerMode = UIDatePickerModeDateAndTime;//The mode you want...
It doesn't change
__________________
Haters gonna Hate
Likers gonna Like
Bertrand21 is offline   Reply With Quote
Old 05-17-2011, 12:44 AM   #7 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

Quote:
Originally Posted by Bertrand21 View Post
So if you change it like so:

Code:
yourDatepicker.datePickerMode = UIDatePickerModeCountDownTimer;//Some random mode...
yourDatepicker.datePickerMode = UIDatePickerModeDateAndTime;//The mode you want...
It doesn't change
Yes, I used setDatePickerMode, but same thing.
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-17-2011, 07:05 PM   #8 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

No ideas, anybody?
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-18-2011, 03:05 AM   #9 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

use reloadAllComponents
__________________
dany_dev is offline   Reply With Quote
Old 05-18-2011, 11:01 PM   #10 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

I'm trying this

Code:
[datePicker reloadAllComponents];
but the app freezes and says

Code:
-[UIDatePicker reloadAllComponents]: unrecognized selector sent to instance
This should be the right way to use it, right?
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-19-2011, 12:31 AM   #11 (permalink)
Beast Mode
 
Join Date: Dec 2008
Age: 21
Posts: 1,971
Bertrand21 is on a distinguished road
Default

Quote:
Originally Posted by ansonl View Post
I'm trying this

Code:
[datePicker reloadAllComponents];
but the app freezes and says

Code:
-[UIDatePicker reloadAllComponents]: unrecognized selector sent to instance
This should be the right way to use it, right?
That is because UIDatePicker does not inherit from UIPicker. So that Method is not available on the UIDatepicker.

Your just gonna have to rebuild it I guess.
__________________
Haters gonna Hate
Likers gonna Like
Bertrand21 is offline   Reply With Quote
Old 05-19-2011, 12:39 AM   #12 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Try:
Code:
[datePicker reloadInputViews];
Domele is offline   Reply With Quote
Old 05-19-2011, 12:43 AM   #13 (permalink)
Etched In
 
ansonl's Avatar
 
Join Date: May 2009
Location: Fremont, California
Posts: 245
ansonl is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Try:
Code:
[datePicker reloadInputViews];
I wish it worked, but it didn't seem to do anything. Have you tried it successfully before? Maybe I just didn't do something right...
__________________
Look...

Apparent Etch
ansonl is offline   Reply With Quote
Old 05-19-2011, 02:25 AM   #14 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Quote:
Originally Posted by Bertrand21 View Post
That is because UIDatePicker does not inherit from UIPicker. So that Method is not available on the UIDatepicker.

Your just gonna have to rebuild it I guess.
right......i haven't checked

So seem that he need to recreate it.....
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
label, today, uidatepicker date seconds

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 352
7 members and 345 guests
doffing81, dre, iOS.Lover, Kirkout, MikaelBartlett, PlutoPrime, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0