I’m trying to create a UITextView in my Main UIViewController when a UIControlEventTouchUpInside happens with my UIButton which is in a UIPopoverController.
I tried to use a delegate protocol to allow my button to be referenced within the Main viewcontroller.m but I don’t think I have been doing it right. I will also mention I’ve created the UIButton and UITextField programmatically in a UIView subclass for the UIPopover.
I’m trying to create a UITextView in my Main UIViewController when a UIControlEventTouchUpInside happens
Share
The view controller that you display in the
UIPopoverControllershould look something like this:Meaning that you could keep a weak reference to the view controller in which you want to add the text field. The button you generated in this
MyViewControllerForPopovercould do something like:The key concept is that you want to have a weak reference (to avoid retain cycle) to the view controller you wish to alter. Even better if that view controller has a method to actually add the text field itself. Hope it helps!