I wanna update my date/time from a view and update that date/time to another textfield in a different view , how do i link this together ?
And for a date picker how do i enable the hr and mins to be scrollabl开发者_如何学运维e at all times , for eg. in my case if the time is 10 now . onli 10, 11 and 12 will be able to be scrollable (black) the rest of the hrs will be in grey .
For the updatinf of textfield with picker value you need to take value from picker and pass that value to the view where the textfield is .This can be done when you are push or present to the view controller or you can do that by NSUserDeaults.
Now for the picker part you can set the minimum time and maximum time which will help you to do the task you wanted to do(for the picker view) . Hope i am clear.Do ask if you dont get anywhere.
For the first part of the question , where you want to update stuff from one view to another, you can either set it as a property
in your class. You can reference
that class in another view and get the data in that variable. Or you can use NSUserDefaults
for passing data back and forth. And then just use [textField setText: stringfromClassOne]
.
For the PickerView
and for having stuff in a different colour, use the property of alpha
and then reduce the alpha for fields below specific time.
精彩评论