I've been trying to complete some basic tutorials to familiarize myself with UIViews and ViewControllers, but some tutorials I see ask me to select an "app name App Delegate" icon in the dock (just left of the Interface Builder panel). I'm seeing the icons for Placeholders: "File's Owner", "File's Responder" and icons for the Objects I've added to my view, but no icon for an App Delegate.
This is using an iOS Empty Application and not any other template when creating a new project and I'm basically trying to connect my App Delegate's rootViewController outlet to a view Controller in a nib file.
Has this icon been removed from XCode 4.2? Is it somewhere else or can be accessed in a different way? I'm guessing a lot of my confusion is because I'm referencing tutorials that came before XCode 4.2 and the new iOS 5 SDK. I'm really new to XCode and iOS in general and the lack of up to date tutorials is not helping my confusion. Any help would be greatly appreciated!
The default Xcode 4.2 templates no longer have the app delegate created by the xib. Instead, the class name is passed into UIApplicationMain so that can instantiate it. This change was made as part of Storyboard support, as I understand it.
I'm almost positive that I've had the same problem, but I figured out that for whatever reason, it would only accept the icon in png format. Try that and see if it works. If this answer is completely off topic, blame that on my lack of sleep for the past 36 hours.
Related
When I click new file and go to user interface tab, I don't see the application or window options. The application file description should say "An Interface Builder document suitable for creating an iOS application, including an application delegate and window." I tried searching in the search bar in Xcode but application did not show up for iOS.
Please see screen shots and difference for clarity.
app delegate screenshot 2
my screen
Apple introduced storyboards back in 2011. Before that, developers used a .xib file to specify their user interfaces, and the "main" .xib file, i.e. the first one that the app loaded, included a proxy for the app delegate so that it was easy to connect objects to outlets in the app delegate. As matt has indicated, though, things haven't really worked that way for a while. As he says, it sounds like you're working from an old book or online tutorial, and as a result your expectations don't match the reality of modern iOS development.
These days, apps generally use a storyboard to specify all or part of the user interface. A big problem with .xib files was that you had to load an entire file at once; if you instantiated a view controller with -initWithNibName:bundle:, the entire file was loaded. That meant that you could only specify a single view controller in a given .xib file, and managing the relationships between view controllers was harder than it should be. Storyboards address this problem -- a single storyboard typically contains several view controllers.
I agree with matt that you really shouldn't work from material so old that it expects you to use .xib files to build your application. That story again:
STOP USING THAT INFORMATION
There are plenty of great resources (notably matt's own iOS 9 Programming Fundamentals with Swift) that will teach you how to write modern iOS code. Apple's own documentation is a great place to start.
I am following a hello world tutorial for xcode. I opened my LaunchScreen.xib file in Xcode6, here is how it looks like:
But according to the tutorial, there needs to be an Objects tab. Can anyone tell me where i can find it?
Thanks
Edit: Here is how it looks like in the tutorial:
I want to find my AppDelegate.h file but i cannot find it.
The Objects section of the document outline has been removed. Everything that was formerly under it is now a top-level item in the document outline. So everything that you now see in the outline that isn't under the “Placeholders” section would formerly have been under “Objects”.
Xcode's project templates have changed since your tutorial was written. When your tutorial was written, the template used a xib file that contained the app delegate and the window. Now, the template uses a storyboard. The system instantiates the app delegate and the window automatically and loads the initial view controller and its view from the storyboard.
The xib you are looking at (LaunchScreen.xib) is a new feature for iOS 8 that replaces the launch image PNGs you must use in older versions of iOS. It is not the xib you are looking for to work through your tutorial.
It would be possible to modify your project to match what the tutorial assumes you have, but doing so is probably not worth the effort. Look for a tutorial written for Xcode 5.1 or later that assumes you are starting with a storyboard.
I'm new to iOS programming and is currently following the tutorial at http://codewithchris.com/demo-app-with-xcode-and-interface-builder/
We first create a new project using the Single View Application library.
Question: About half way into the tutorial, it says Once you have ViewController.xib opened on the left pane and ViewController.m opened on the right pane... However there is no .xib file anywhere in the Project Navigator, and this is the first mention of an .xib file in the tutorial.
Am I supposed to get a .xib file somewhere along the way? If so, which step will create the .xib?
XIB is an older format of Interface Builder. In newer versions of Xcode, by default, the project is created with a storyboard (Main.storyboard in your project). The difference is that in storyboards, you can see all the views of your app at once (and transitions between them), and with XIBs you have to keep them separately.
I'm not sure about this (can't check it right now), but if you insist on using XIBs, there should be a checkbox somewhere during creating a project. Anyway, I recommend you getting familiar with the storyboards, they are supposed to be a successor to XIBs.
As I can see in the tutorial, the author says 'XIB' even if he has a storyboard in his project, probably because he got used to XIBs. All in all, they are very similar in usage.
Actually storyboards contain .xibs (in your project one .xib as you created single view app.) The xib is just the user interface file shown in your second screenshot.
You just have to click the "Show assintant editor" on top right (the button with the suit) to split the xcode window and see the xib alongside the viewcontroller header/or implementation files.
I can no longer simply right click and drag from a button to a view controller to create a view switch via the Modal function in Xcode 5?
I've searched everywhere, but seeing as Xcode 5 is fairly new, I can't find anything on it.
I'll continue to search the Apple Documentation just in case no one can provide an answer here, but does anyone know what's wrong?
Is this feature excluded from Xcode 5 and I am forced to code it in?
The feature you are talking about is called Storyboard Segue and it's definitely available in Xcode 5.
Be sure you are dragging from the UIButton and not from it's superview.
Restarting Xcode may also help.
SO,
I am new to iOS programming (and Macs for that matter!) and having trouble getting my feet wet with the Master-Detail Application template in Xcode (specifically for an iPad).
I created a new project using standard settings, then went to the auto-generated "Mobile Master View Controller" entry on the storyboard (I believe it's called a "scene") and added a a bunch of static table cells and a couple of groupings. Looks great in the Storyboard!
When I run it in the Simulator, the navigation is completely blank. I've tried googling and researching, but I don't know if I'm using the correct terminology or keywords as I can't find an answer to something that seems very simple... I've seen some tutorials that mention right-clicking and dragging things in the Storyboard to create IBOutlets and other connections, but I don't know if that's needed here or not.
I have no code to present yet as this is all done in the Storyboard so far. Is any code needed to make this work or am I missing a setting perhaps?
This tutorial should help to you: http://www.raywenderlich.com/29469/ipad-for-iphone-developers-101-in-ios-6-uisplitview-tutorial