However this doesn't work as the popover remains. Is what I'm trying to do even possible?
__________________ PicBoard - a visual support app for children with autism, communication difficulties or learning difficulties. Available now for iPad.
TalkBoard - Adds Communication Aid features to PicBoard, for non-verbal children or adults. Available now for iPad.
You made a completely new view controller and dismissed its popover. That doesn't make any sense. You need to dismiss the popover you already have.
Ok, that makes sense. So how do I reference the popOver which I am trying to dismiss?
__________________ PicBoard - a visual support app for children with autism, communication difficulties or learning difficulties. Available now for iPad.
TalkBoard - Adds Communication Aid features to PicBoard, for non-verbal children or adults. Available now for iPad.
You have to keep a reference to it. If your view controller already has a myPopOver property, put the popover in there before you show it.
MainViewController does have the myPopOver reference, and the popOver is created there ready to be displayed. The problem I'm having is working out how to refer back to it. I've just tried this:
__________________ PicBoard - a visual support app for children with autism, communication difficulties or learning difficulties. Available now for iPad.
TalkBoard - Adds Communication Aid features to PicBoard, for non-verbal children or adults. Available now for iPad.
The key to getting the myPopOver to be able to dismiss itself was to give the PopOverController a "parent" property of type MainViewController, then set that to "self" when creating the PopOver in MainViewController. Then the following line dismisses the popOver from within myPopOver.m:
Code:
[parent.myPopOver dismissPopoverAnimated:YES];
__________________ PicBoard - a visual support app for children with autism, communication difficulties or learning difficulties. Available now for iPad.
TalkBoard - Adds Communication Aid features to PicBoard, for non-verbal children or adults. Available now for iPad.
The key to getting the myPopOver to be able to dismiss itself was to give the PopOverController a "parent" property of type MainViewController, then set that to "self" when creating the PopOver in MainViewController. Then the following line dismisses the popOver from within myPopOver.m:
Code:
[parent.myPopOver dismissPopoverAnimated:YES];
Hello,
I understand the above statement, but I am new to Objective-C, if it is not to much trouble, can you post the code you used to create the "parent" in each .h and .m file. Thanx in advance.