If I wanted to do something like this myself, not a date but some other rotating list of items, I would probably use a UIPickerViewDataSource to tell the UIPicker it has a vast number of rows and I'd start the picker index 1/2 way through that range. Then I'd return a title from pickerView:titleForRow:forComponent: modulus the number of things I actually have in the list.

eg I'd tell the picker I have 20000 rows, start at row 10000, if I had 123 actual pieces of data I'd return value '0' for 9754, 9877, 10000, 10123, 10246 etc. You only need the 123 pieces of data, the rest is just mapping it onto a huge range.

Were I concerned it was really possible to run off the end I'd attempt to find a reasonable point (perhaps at selection) to reset the index back to a central value again.

In this case however .. the built-in date or time pickers are what you want.

On 19-Oct-2009, at 9:49 PM, Luke the Hiesterman wrote:

Just use a UIDatePicker on mode UIDatePickerModeTime or UIDatePickerModeDateAndTime and you should be all set.

Luke

On Oct 19, 2009, at 6:44 AM, Eric E. Dolecki wrote:

I have a fairly noob question in regards to recreating an alarm view using a
Picker control.
On the iPhone, the values for hours & minutes wrap around - and I was
wondering if this is accomplished by repeating values in an NSArray (so many that you're not likely to scroll to them), or are they using another trick
to get the values to loop around in the control?

I am really just making my own alarm setting UI using the Picker.

Thanks,
Eric
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com

This email sent to luket...@apple.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org

This email sent to r...@rols.org

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to