I created a project in xcode 4.2 using the feature of storyboard. I have done most of the work but now i came to know that storyboards are not available in pre-iOS 5 devices. Is there any way to remove this storyboard from the project without creating a new project? I don't want to do all the work again... any suggestions?
Delete the "Main Storyboard base name" in your Info.plist file and add a "Main nib" name (what was MainWindow in standard templates) or supply your app delegate class name to UIApplicationMain() in main.m
Related
I am experimenting with Interface Builder in Xcode 4.2 and iOS 5 on a old Mac.
In Xcode 3.2 there was always a MainWindow.xib file and it contained not only the File's Owner which was UIApplication IMHO, but also an App Delegate placeholder object.
I created a MainWindow.xib file using the Window xib template. The AppDelegate placeholder is missing, so I can't hook the window up to my actual app delegate object.
I suppose that I will need to add a placeholder object with it's class identity set to "AppDelegate" but couldn't figure out how.
Just drag out one of the blue cubes (called "Object") from the objects library and change its class to the class of your app delegate.
May sound like a stupid question, but I simply can't find the function of adding subclasses in XCode 4.3.2 anymore. I am sure, in the previous release of XCode I could choose the subclass of the view, before actually pressing the Create button in the dialog.
I was not using the storyboard, when I initially created my project. Is this the issue?
Thanks, René
File > New > Files > Cocoa Touch > Objective-C class > Next > Subclass of ...
OK, found the answer myself: File / New File / Cocoa Touch, Objective-C Class, Subclass of UITableViewController and set Option With XIB for user interface.
Is there a convenient way to generate code from any new view controllers I've created on the storyboard? For example when you create a new iOS application, XCode will set up a skeleton class for your view controller.
Thanks!
I don't think so. You need to create a new ViewController subclass in XCode but uncheck the "Create Xib for this class" box (not sure if that is exactly what it says). Then select your newly made view controller in storyboard and change it to the class you just created.
Ok the skeleton you are talking about is just a template for your application. You are asking for a dynamic template generator from your storyboard and maybe Apple can figure out how to do this in a non distant future but in this moment I think you can't do that. After you created the storyboard file with your complex scheme you need to manually create all your viewController subclass you used in the storyboard. It's not a big deal ... I suppose your application doesn't have thousand ViewController so you can do it manually.
Apple are working hard to simplify developers job but Xcode can't do everything for you.
You can try to post this answer directly to Apple throughout the bugreport Apple website and post it as improvement to implement in future Xcode release.
Lets try it :)
I'm trying to start a universal app using Xcode and I'm totally lost. I started the universal Window based app from the templates. I'm trying to have a UITableViewController for the iPhone, and a UISplitViewController for the iPad. I see 3 appDelegates, and did read this post http://www.kotancode.com/2011/04/05/ios-universal-apps/ , but I'm still really confused. I started by creating a UIViewController subclass in the iPadAppDelegate folder with a .xib. Nothing is in the file yet. Then in the iPadAppDelegate.h:
#property (nonatomic, retain) IBOutlet HomeViewController_iPad *homeViewController;
Dragged a UIViewController in the MainWindow_iPad.xib, changed the class to HomeViewController, and tried dragging an outlet from the MainWindow to the UIViewController and I am not able to connect the HomeViewController.
I thought I could do somthing like this for the iPhoneAppDelegate as well, but I believe I am missing something from the Universal App Template. Can someone give me some advice on how these 3 appDelegates work and how I can get started? TIA
Universal Apps are really simple once you grasp how they work.
The reason there are three AppDelegates is that you usually have one that is the base class for an iPhone and iPod specific app delegate. The entry-point into your iPhone or iPad Application is based on the configuration in your .plist file, if you select the project in xCode 4 it will show you a graphical configuration dialog that will allow you to change those properties. The so called "Main Interface" is independently selectable for iPhone and iPad in the respective deployment section. The Main Nib file does contain a serialized version of the device specific app delegate, which will then be "woken up" when the application is loading. This process is triggered from your Main() method when
UIApplicationMain(argc, argv, nil, nil)
is called. UIApplicationMain does take care of loading the proper NIB file, based on the device it is run on.
Thats all there is.
I have an old project in Xcode and I want to change the RootViewController files (.m, .h, .xib - a TableViewController) with a normal ViewController!
Is it possible or I must restart a new project and import the old files?
Depends on how your project is set up. But you may just need to include and change the controller linked to by the window and app delegate in your MainWindow.xib file.