I am writing a universal application. As far as I can tell, it's not possible to use Interface Builder to link an IBOutlet, which is already linked to the iPhone storyboard, to the iPad storyboard?
What are possible workarounds for this? Should I just edit the storyboard via text editor?
It doesn't really seem sensible to have an IBOutlet for each device if it's the exact same element behaving in the exact same fashion.
Cheers-
You should be perfectly capable and able to add IBOutlet's to both an iPhone_Storyboard file and likewise the same IBOutlet's on an iPad_Storyboard file. What does it appear to be doing, simply detaching your previous connection in the other Storyboard file?
I've done this on multiple universal applications without an issue.
I ran into this issue as well. My problem was that I forgot to make sure that the Custom Class of the UIView were the same in both the iPhone and iPad versions of the storyboard. After fixing that, Xcode instantly let me connect the outlets.
Related
When working in the .h or .m of my iPhone app in XCode, the Object Library contains a lot of nice buttons and stuff, i.e. a checkbox, which I would like to add to the interface. But when I enter the storyboard, it changes to just "Objects" and many of the buttons are replaced with view controllers and other stuff. How can I find the Object Library with all the buttons in my storyboard? I wanna add some checkboxes etc in my app. Thanks.
See when you are working in .h and .m the object library shows all the stuff of iPhone/iPad and Mac.but when you open storyboard for iPhone/iPad all the stuff regarding Mac development is gone ,only the stuff relevant to iPhone/iPad is shown.
I'm creating an iPad version of an iPhone app (NOT universal). I created copies of all my .m .h and XIB files, and appended "iPad" to the end of each, as well as to all my classes. This of course was tedious and overly complex but I didn't know a better way.
My problem: When I connect the iPad File's Owner and First Responder to my iPad XIB (see image) Xcode connects the XIB shown below to the iPhone ViewController code and not the iPad ViewController code.
I then went to the code (see below) to see if I could instead connect straight from the code (with those little circles to the left of Outlet code lines) but to no avail. When I click and drag the line and let go over the XIB it doesn't work. It doesn't do anything.
How do I associate (for lack of a better word) my iPad XIB with my iPad code? The iPad XIB is already part of the target build, FWIW.
Click on FileOwner in iPad xib file..
Go to identity inspector..in the Utilities Section.
You will see the class name there..Make sure it points to the iPad code class
Make sure that you've included the correct File name in your XIB in the File Inspector. This should match the class you are trying to connect objects.
Check the class you given for each xib is correct .that is in the identity inspector
Try this
File->Reload All Class Files
File->Read Class Files (select MyClass.h)
Reconnect File's Owner by
a. Setting the Class to "MyClass"
b. Reconnecting the View to the File's Owner's View
Everything is back to normal now. Weird.
Hope this helps more than it confuses ;-)
Is it possible to make an advanced UI, such as the twitter app for iPad, using storyboards? I am new to them and all the reading I have done on storyboards make them seem rather simplistic. Can you do most everything you could with nibs with a storyboard?
A storyboard isn't much different from a group of .xibs. The advantage they provide is that you can see the relationship between the different view controllers. So sure -- anything you can do with a .xib you can also do with a storyboard.
I have been trying to integrate the TTPhotoViewController into a UITabBarController for a while but have not succeed.
The TTPhotoViewController works fine in a stand-alone fashion but I can't "press it" into a TabBar.
Has anyone come across an example that would do it?
Your help is much appreciated.
I had the same issue, but I found an alternative solution than using Three20. I ended up using the KTPhotoBrowser found at: https://github.com/kirbyt/KTPhotoBrowser
I got KTPhotoBrowser working in about 15 minutes. What I like most is its simplicity: just copy a few .h/.m files to your project. That's it...
It is only a photo browser though, no extra controls as Three20 has...
Also, with a couple of "release" removals, it is ARC compatible in iOS5, and storyboard plays well with it. It comes with samples for local pics, flickr, or web site pics.
Works in tabbarcontroller if you place the view controller inside a navigation controller, although it seems to have interfered with my subclassing of tabbarcontroller which I had implemented in order to have landscape orientation enabled for one of the views (to show video).
I'm reading through a beginners iPhone text book and just finished writing all the code for a route tracker app that uses Map Kit and Core Location. I have the app running with no errors on my iphone 4 device but when I tried interacting I realized that none of my IBOutlets were connected to anything. When I referenced the beginning of the tutorial in the text, all it says is to "connect the appropriate outlets".
Here's why this usually simple task has me confused. The tutorial says to create a Window Based Project, so there is no ViewController. Then, in Interface Builder, the view is built in MainWindow.xib. The only IBOutlets of the project are located in Controller.h / Controller.m files that you create and which contain mostly all of the code for the app.
I usually ctrl-drag from File's Owner to the UI in Interface Builder, but in this project there seems to be no way for me to access the IBOutlets in Controller.h / .m from the MainWindow.xib file.
I'm frustrated because it seems like this should be such an easy fix but I'm totally stumped.. any help is really appreciated. Thanks
As I see it, you have two choices:
Add the outlets to the app delegate. This is probably not the best plan.
Put an instance of your controller class in the .xib file.
I think option 2 is what you want. If you check the Controllers section of the library, you'll see a component called "Object". Drag one of those into your xib, then inspect it. Select the info pane in the inspector (the circle with a white i in it) and change the Class to the name of your controller class.