iPad for iPhone Developers 101 in iOS 6: UIPopoverController Tutorial

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

iPad for iPhone Developers 101 in iOS 6: UIPopoverController Tutorial

Postby rwenderlich » Tue Mar 26, 2013 12:00 pm

This is the official thread to discuss the following blog post: iPad for iPhone Developers 101 in iOS 6: UIPopoverController Tutorial
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2144
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 332 times

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby GaProgrammer » Thu Mar 28, 2013 12:55 am

Have MacBook with Lion 10.7.5; xCode 4.6.1
When I click on button Chose Color I get error at return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
in main.m
Debug window shows:
[RightViewController chooseColorButtonTapped:]: unrecognized selector sent to instance 0x71cf750
2013-03-27 20:51:08.362 MathMonsters[8661:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RightViewController chooseColorButtonTapped:]: unrecognized selector sent to instance 0x71cf750'
*** First throw call stack:
(0x1c98012 0x10d5e7e 0x1d234bd 0x1c87bbc 0x1c8794e 0x10e9705 0x1d2c0 0x259a64 0x10e9705 0x1d2c0 0x1d258 0xde021 0xde57f 0xdd6e8 0x4ccef 0x4cf02 0x2ad4a 0x1c698 0x1bf3df9 0x1bf3ad0 0x1c0dbf5 0x1c0d962 0x1c3ebb6 0x1c3df44 0x1c3de1b 0x1bf27e3 0x1bf2668 0x19ffc 0x1e1d 0x1d45)
libc++abi.dylib: terminate called throwing an exception

I have no idea what the problem is. I've only been using xCode for 3 days.

Thanks
Charlie
GaProgrammer
n00b
 
Posts: 4
Joined: Thu Mar 28, 2013 12:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby shippo0708 » Thu Mar 28, 2013 1:01 am

Please use code tags next time

Does your RightViewController have a function called chooseColorButtonTapped? the app cant seem to find it, maybe misspelled
User avatar
shippo0708
Uber Haxx0r
 
Posts: 679
Joined: Fri Apr 15, 2011 4:06 am
Location: Texas
Has thanked: 2 times
Been thanked: 51 times

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby GaProgrammer » Thu Mar 28, 2013 3:33 am

I'll check; but I'm running the code that I downloaded from the website
GaProgrammer
n00b
 
Posts: 4
Joined: Thu Mar 28, 2013 12:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby designatednerd » Fri Mar 29, 2013 10:25 am

Hi Charlie,
I pulled a fresh copy of the version of the project linked at the end of the tutorial, since that's the only one that would have the Choose Color button, down from the website and I'm not seeing the same issue in Xcode 4.6.1. My best guess (and without looking at the exact files you're looking at, it'd definitely be a guess) is that while looking through the files, you may have accidentally disconnected the IBOutlet.

I'd give a shot to downloading a fresh copy and running it immediately before doing anything else - if you're still experiencing this issue after you do that, let me know. Thanks!
-Ellen (tutorial author)
User avatar
designatednerd
Team Member
iOS Tutorial Team Member
 
Posts: 17
Joined: Fri Feb 08, 2013 4:24 am
Location: Chicago, IL
Has thanked: 0 time
Been thanked: 3 times

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby GaProgrammer » Fri Mar 29, 2013 5:36 pm

Thank you. I'll try that.
Charlie
GaProgrammer
n00b
 
Posts: 4
Joined: Thu Mar 28, 2013 12:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby GaProgrammer » Fri Mar 29, 2013 5:49 pm

Downloaded "new" files. And ran the app as suggested and it worked. However, upon opening the app I have a message that 1 target, missing base sdk. When I click on the ! alert I get a list of things that needed to be upgraded. Did the upgrade and the app still ran without error.
Thank you,
Charlie
PS I sincerely appreciate folks like y'all that are so willing to help people like me! The learning curve continues.
GaProgrammer
n00b
 
Posts: 4
Joined: Thu Mar 28, 2013 12:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby csann » Sat Mar 30, 2013 5:33 am

How could I make the left side popover work like a "real" popover?

In other words, I want the monster button to always be visible (in both portrait and landscape), and when the button is pressed the master vc pops up in a real popover, not slide in from the left.
csann
Baby Hacker
 
Posts: 8
Joined: Sun Oct 14, 2012 11:37 pm
Has thanked: 2 times
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby designatednerd » Sat Mar 30, 2013 10:37 pm

csann wrote:How could I make the left side popover work like a "real" popover?

In other words, I want the monster button to always be visible (in both portrait and landscape), and when the button is pressed the master vc pops up in a real popover, not slide in from the left.


The biggest thing to bear in mind is that UISplitViewController is a very specialized kind of user interface. The behavior where the drawer slides out rather than being a traditional popover is the default, expected behavior for UISplitViewControllers since iOS 5.1. The reason we make the button disappear when you rotate into landscape is that you no longer need it when the tableview shows up on the left side of the screen - you're already seeing what you'd want to see when you hit that button.

Do you want to have a single view that is the primary view no matter what the orientation of the device is, and then only show the left-side menu as a popover, regardless of orientation? If that's the case, you'll want to avoid using a UISplitViewController altogether - the drawer functionality is built in to that and is the default behavior for that type of view controller as of somewhere around iOS 5.1.

What you'd want to do in that instance is get rid of the UISplitViewController and use the RightViewController as the root view controller, and set up the UIBarButtonItem and the UIPopoverViewController separately in essentially the same way as we've got the ColorPickerViewController and popover set up. At that point, the button would persist and the RightViewController would just take up the entire screen. You'd only see the LeftViewController presented in a popover when you clicked it, the same way the ColorViewController works now.

If that's not what you're trying to do, if you could please clarify a bit what you're looking for, that'd help me help you come up with a solution. Thanks!
User avatar
designatednerd
Team Member
iOS Tutorial Team Member
 
Posts: 17
Joined: Fri Feb 08, 2013 4:24 am
Location: Chicago, IL
Has thanked: 0 time
Been thanked: 3 times

Re: iPad for iPhone Developers 101 in iOS 6: UIPopoverContro

Postby designatednerd » Sat Mar 30, 2013 10:40 pm

GaProgrammer wrote:Downloaded "new" files. And ran the app as suggested and it worked. However, upon opening the app I have a message that 1 target, missing base sdk. When I click on the ! alert I get a list of things that needed to be upgraded. Did the upgrade and the app still ran without error.
Thank you,
Charlie
PS I sincerely appreciate folks like y'all that are so willing to help people like me! The learning curve continues.


Glad that helped - I'm not 100% sure why you got the Missing Base SDK error (the project is set up to use the latest iOS SDK that hasn't been updated in a couple months), but I'm glad that doing a standard repair got you up and running. Let us know if you have any more questions. Thanks!
User avatar
designatednerd
Team Member
iOS Tutorial Team Member
 
Posts: 17
Joined: Fri Feb 08, 2013 4:24 am
Location: Chicago, IL
Has thanked: 0 time
Been thanked: 3 times

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests