Xcode 4.4 Connecting a .h and .m to a View Controller - xcode4.4

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 !

Related

How to work with xib files?

Im playing with this project SquareCropViewController It is a helper for crop images to square. Inside project there are two versions, one made with auto-layout and one that works purely programmatically. I want to use programmatic version and integrate in my project, which works with storyboards.
In programmatic version there are several files
ProgrammaticController.swift
ProgrammaticController.xib
What is the sequence of actions to make it run in my project ? Do I have to create new viewcontroller and import xib inside it? If yes what is syntax ? I have never worked with xibs before and help will be much appreciated.
Thanks in advance
You should be able to just instantiate the class if it's hooked up correctly in the xib.
var controller = ProgrammaticController()
navigationController.push(controller, animated:true)
The file's owner's class needs to be set to the actual class in the xib for that to work.

How to create a new table view in XCode 4.3.2?

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.

storyboard segue cross dissolve?

I want to use the following transition cross dissolve, but I do not want it to appear flicker when Transition
I apologize I have weak English language
You need to add a subclass to your project:
Add a new .h and .m file as a subclass of UIStoryboardSegue
Add this code to your .m file:
- (void)perform {
[self.sourceViewController presentModalViewController:self.destinationViewController
animated:NO];
}
Now go to your .storyboard and add the name of your .m file to the
class field of your prefered segue.
I can't find the storyboard's segue's class field in XCode 4.4.1. Is it possible that the field was in previous versions but not in the current?
EDIT: I found the way. You must select 'custom' when creating the segue and it works.
Thanks.
BTW: The tutorial is not available.

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.

iphone uitableview - linking problems?

I am trying to follow a tutorial about xml parsing http://www.edumobile.org/iphone/iphone-programming-tutorials/parsing-an-xml-file/ . The tutorial does not explain how to link and that is the part that i am stuck on. Looking at the source code provided i can see that "view" is linked with "file owner". In MY file, when i do this, i cannot link them. It does not highlight. Does anyone know why? what are the usual causes for this? (new to iphone). Thanks for any help!
You will find this helpful http://mobiforge.com/developing/story/iphone-programming-fundamentals-outlets-and-actions
This one is specific to XCode4 but is also helpful to understand the Interface Builder basics
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iPhone101/Articles/04_InspectingNib.html
If you add a new file (a subclass of view controller) you will get three files .h,.m and .xib. The File owner is always connected to the correct View Controller which happens to the owner of this nib(.xib) file. you can verify the same as shown in image below.
If this is the case then I am sure you can always link up your new elements (labels,buttons) to the correct Outlet. Just a reminder here that the declaration should start with the keyword IBOutlet so that It shows up in the interface builder.
eq IBOutlet UILabel *lblTitle;