agmcleod
agmcleod

Reputation: 13621

Xcode 4 storyboard, textfields not wanting to connect to IBOutlet

So in the storyboard i have a UIViewController class called FormViewController. I set the ViewController in the storyboard to use that:

custom class

I then have the three text fields in the header file:

#import <UIKit/UIKit.h>

@interface FormViewController : UIViewController

@property (strong, retain) IBOutlet UITextView *firstName;
@property (strong, retain) IBOutlet UITextView *lastName;
@property (strong, retain) IBOutlet UITextView *email;

- (IBAction) save:(id)sender;

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender;

@end

However, when i try to connect the ones in the storyboard to the view controller, it doesnt pop up.

enter image description here

Any ideas?

Upvotes: 0

Views: 29

Answers (1)

andyvn22
andyvn22

Reputation: 14824

UITextField and UITextView are two very different classes—you have created UITextField instances but your outlets are typed as UITextView.

Just change your outlet types to UITextField and all should be well!

(UITextView, for the record, is a scrolling, often editable field, more like a word processor.)

Upvotes: 2

Related Questions