views:

15

answers:

0

Hi, I have following code in viewDidLoad

myViewController = [[UIViewController alloc] initWithNibName:@"myView" bundle:nil] ;
self.myView = myViewController.view;
[self.view addSubview:myView];

This code loads view from myView.nib (I have corresponding view controller m and h files of course). myView view has UITextField and other controls. So far so good - I can see all my controls on the screen.

The problem however is that even though I set a delegate for UITextField to be File's Owner (which is myView) and I implement UITextFieldDelegate in myView.m, delegate methods are never fired!

This does NOT happen if I add UITextField to the original view (created by the XCode as default template). Why is this happening?

The reason I need to useSubview because in actual code will layer view to the UIScrollView so I can pan and zoom.

THanks!