I have a UIPicker that is holding titles. I would like it to when a row is tapped to open to a .xib view/ UIView and have a small textview in it. Is this possable?? If so please help!!
Thanks in advance for any help..
I have a UIPicker that is holding titles. I would like it to when a row is tapped to open to a .xib view/ UIView and have a small textview in it. Is this possable?? If so please help!!
Thanks in advance for any help..
I m not exactly sure what you re asking, but it is possible.
When a UIPickerView has a row tapped, it tells its delegate via the -pickerView:didSelectRow:inComponent:
method.
So, you ll need to set the picker s delegate. You do this by dragging from the delegate outlet to your controller in Interface Builder, or by setting picker.delegate = someObject
in code.
setting delegate http://grab.by/zlY
Then, in the delegate:
- (void)pickerView:(UIPickerView *)pickerView
didSelectRow:(NSInteger)row
inComponent:(NSInteger)component {
// load xib or whatever you like
}
Edit with more info:
To load the XIB you will most likely want to use -initWithNibNamed:bundle:
on a view controller class. In that delegate function above, the number row
is the row which was selected. You can use that row to construct the nib name you want to use.
I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up ...
I have a UITextField that is a subview of a UITableViewCell. When my view loads, I want the text field to become first responder. I have a pointer to the text field in the table cell, so to do this I ...
I want to allow the user to enter a valid date using the iPhone’s settings application. I have experimented with many of the PreferenceSpecifiers data node types including date. I have two issues: ...
I m going to use an example to properly illustrate my confusion. I can t quite wrap my head around this. In Cocoa touch, we have UIViewController and its subclass, UINavigationController. Now, UIVC ...
Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...
I have an app which has to load some data at startup, so I want to display a splash-screen animation. I m using the MPMoviePlayerController to play a m4v file. The movie has it s background set to [...
Is there a way to add a location from an MKMapView in my application to the built-in Google Maps app? From what I understand there is probably one of two ways to do it: using [[UIApplication ...
I m trying to chain animation events. The application I m coding for work has a multiple choice quiz. First you pick your multiple choice answer. The quiz view fades away. Then a label ("correct" or "...