0
만졌을 때 UITextField에 UIPickerView를 표시하려고합니다. UITextField.inputView를 사용하는 것과 동일한 주제에 대해 몇 가지 질문을 발견했습니다. 그러나, 내가 시도 할 때, 아무것도 바뀌지 않는다. UITextField는 xcode 4.3.2에서 UIPickerView를 보여줍니다. textField.inputView를 사용합니다.
내가
은 매우 간단한 코드가 있습니다setupViewController.h
#import <UIKit/UIKit.h>
extern NSString *setupRightChannel;
@interface setupViewController : UIViewController
{
UITextField* rightChannelField;
UIPickerView *channelPicker;
}
@property (retain, nonatomic) IBOutlet UITextField* rightChannelField;
@property (retain, readwrite) IBOutlet UIPickerView *channelPicker;
setupViewController.m
#import "setupViewController.h"
@Interface setupViewController()
@end
@implementation setupViewController
@synthesize rightChannelField;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = @"Setup";
// Do any additional setup after loading the view from its nib.
rightChannelField.inputView = channelPicker;
}
-(IBAction)okClicked:(id)sender
{
setupRightChannel = rightChannelField.text;
}
내가 여기에 근본적인 뭔가를 누락 될 수 있습니다 같은 느낌을하지만, 솔직히 그게 뭔지 생각할 수 없다.