r/simpleios • u/lkjasdflkjasdf • Jun 27 '12
Is it possible to call a method from the presenting class when using presentModalViewController?
Ex: tableViewController presents (modally) a single view controller. Can the single view controller access something like parent.method1(). Method1 exists in tableViewController.
Edit: forgot to add: without using a protocol/delegate.
7
Upvotes
2
u/BOSS_OF_THE_INTERNET Jun 28 '12
I believe there is a 'presentingViewController' method baked into UIViewController as of iOS 5.
Barring that, you could always use NSNotificationCenter.
2
u/[deleted] Jun 27 '12
Perhaps setting the instance of the parent view as a property on the child and accessing the method that way?