Closing an UIPopoverController from the subview, wether it is a UINavigationController any other type of controller can be a little bit of an hassle. I had this problem today and figured it out quickly. I thought of sharing this solution here.
The solution itself is quite simple. The ViewController creating the UIPopoverController is being reused to close it as well. This means that the UIPopoverController needs to be an accessible variable throughout that class.
So, how do we close it? well, this is how:
In the class opening the popover, this is my code:
I know, its the longest title of a post.. ever. But… This is something I deal with everytime I reinstall one of my macs, and for the sake of saving some time I thought of writing it down here.
I expect you have OS X 10.8 installed (or higher), but this should also work with OS X 10.7.
Before you can use MacPorts you need to install XCode and “Command Line Tools”. You can do this by opening XCode, opening the Xcode menu and choosing “Preferences…” (pic 1). In the new window that opens, choose “Downloads” (pic 2) and select “install” next to “Command Line Tools”.
As some of you might know, I am writing an XCode Cookbook. This is a book which will contain only tutorials on how to do different things within XCode. So, no tutorials like “Adding Facebook to my iPhone app”, but more in the style like “Adding custom location to the iOS Simulator” or “Managing multiple targets within my project”.
I have a list of about 50-60 tutorials, but I need more. I need about 40 tutorials (3-4 chapters) more, so I am looking for tips; and since you, my readers, come here for such things, who better to ask but YOU!
Well, to sum it up… this has been a “pain in the ass” for me. The last few days I have had some trouble running OS X 10.8 (Mountain Lion) preview… which is not that weird since it is a developers preview. The main problem was that MacPorts didn’t work since 10.8 uses Darwin 12 and Lion (with MacPorts 2 installation) uses Darwin 11.
So, I managed to screw things up so badly that I spend whole yesterday evening copying files manually to a USB drive using the “Install Disk” for Lion. Now I formatted my MacBook Air and Mac Mini and installed Lion once again.
Since the release of XCode 4.2 I have noticed a certain error poping up after buidling reguarly. The error incidcates that the iOS Simulator already has a process running or is hung. The anoying part is that even if you quit XCode and iOS Simulator, the problem wont go away.
This is the error:
Couldn’t register com.myApp.debug with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.Program received signal: “SIGABRT”.