I have a XIB file with a UITextView, which I'm associating with a UITextView* outlet in my controller:
@interface MyController : UIViewController <UITextViewDelegate> {
IBOutlet UITextView *textView;
}
@property (nonatomic, retain) IBOutlet UITextView *textView;
I've aded the prototype in desperation, I've not implemented any of the methods of the delegate.
My view is loaded from a tab bar defined in my main XIB file. When I tap on the relevant tab bar button, an exception is thrown immediately (before any controller methods are called). The top of the call stack looks like this (from the debugger):
#0 0x93829bc6 in -[NSException raise]
#1 0x9157f8f8 in _NSSetUsingKeyValueSetter
#2 0x9157f35e in -[NSObject(NSKeyValueCoding) setValue:forKey:]
#3 0x91603f81 in -[NSObject(NSKeyValueCoding) setValue:forKeyPath:]
#4 0x30c1fadb in -[UIRuntimeOutletConnection connect]
#5 0x9381ebe5 in -[NSArray makeObjectsPerformSelector:]
#6 0x30c1e629 in -[UINib instantiateWithOptions:owner:loadingResourcesFromBundle:]
#7 0x30c2068c in -[NSBundle(NSBundleAdditions) loadNibNamed:owner:options:]
#8 0x30ac6f26 in -[UIViewController _loadViewFromNibNamed:bundle:]
It appears that there's some problem setting the text view outlet. I'm sure it's related to the UITextView because if I comment out the text view related code and remove the text view from the XIB, the view loads fine. There's no error message available on the console.
Are there any special considerations with UITextView elements when created in IB? I've got it connected to the IBOutlet in my code and the delegate is set to the 'Files Owner' (I've also tried it without a delegate).