How to create a new table view in XCode 4.3.2? - iphone

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.

Related

Create new cocoa touch class missing in Xcode 7

In previous versions of Xcode you could do New > File > Cocoa Touch Template to create a subclass of a UIViewController with the proper imports, viewDidLoad() method and so forth. This seems to be missing from Xcode 7. When I do New > File, Cocoa Touch Template is missing. I can create a new Cocoa class, but this does not subclass UIViewTemplate. Is there any way to create a view controller class quickly in Xcode 7?
Open Xcode
Go to File -> New -> File
Under the iOS section, select Cocoa Touch Class. Click next
For the section that says Subclass of: type in UIViewController. For the section that says Class: type in the name of your subclass.
Click next and save the file in the default folder.
If Xcode is not showing Cocoa Touch Class and showing Cocoa Touch instead, tap on the iOS section again and Cocoa Touch Class should appear.

How to hook up the window of MainWindow.xib with the AppDelegate in Xcode 4.2?

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.

Xcode 4.4 Connecting a .h and .m to a View Controller

I'm using Xcode 4.4 and I'm trying to connect the .h and .m files to the view controller in my storyboard but the options I have for adding files are:
Objective-C class
Objective-C category
Objective-C class extension
Objective-C protocol
Objective-C test case class
Every tutorial and answer I have found is for the 4.2 version which goes the option of Objective-C subclass which I don't have. I was wondering if anyone knew how to do it in 4.4.
Thanks
I had the same problem and just found the answer.
First, make sure to read Xcode help about storyboard (in help menu, type story...)
Second, Make sure XCode show you his full interface (in the tool bar, select all three view icons, or at least the bottom right and bottom left icon.
There is a video in the help which explain how to do so.
why you have to connect .m and .h to the view controller ?
try the easy way: file - new file - objective c class and in the second windows check "with XIB interface".
with this, you'll get .m .h and .xib !

Can't find UIView Subclass Template in XCode 4

Did it disappear ? In XCode 3 it did exist. How to create a subview class in XCode 4 ?
You want to create a template or class...?
A subview class can easily be created by File -> New -> Objective-c Class - > UIView Subclass ..->save
What's the problem in adding just a normal UIView??
Make sure you are choosing your xib file to be an iOS User Interface Empty file, not a Mac OS X one. In the latter, only NSView is available, not UIView.

How to generate .m/.h files from Storyboard?

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 :)