Curnelious
Curnelious

Reputation: 1

UIDatePicker interval of 10 minutes?

I am trying to set a picker for times with 10 minutes intervals so : 8:00,8:10,8:20 , etc , with the minute interval property :

UIDatePicker *timePick = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height/1.5)];
timePick.datePickerMode =UIDatePickerModeTime;

[timePick addTarget:self action:@selector(dateIsChanged:) forControlEvents:UIControlEventValueChanged];
timePick.minuteInterval=10;

What happens is that the times are like this :

13:00
14:10
15:20
16:30

Now if trying to set the hours interval , cant find a property for this .

Whats wrong with it ?

Upvotes: 6

Views: 7469

Answers (1)

Bogdan
Bogdan

Reputation: 863

I guess you are referring to the minuteInterval property which is available from iOS2 and later. See below Apple's documentation.

The interval at which the date picker should display minutes. You can use this property to set the interval displayed by the minutes >wheel (for example, 15 minutes). The interval value must be evenly divided >into 60; if it is not, the default value is used. The default and minimum values are 1; the maximum value is 30.

Upvotes: 17

Related Questions