How to set Interface Builder document versioning default to 4.2? - iphone

When I create a new xib in interface builder the Interface Builder Document (Versioning) development parameter is defaulting to xCode 4.1
Is there anyway to default this to xCode 4.2 - The reason I ask is I recently changed a project to use IOS 5 and 4.2 - The project was originally created in 4.1, and when I create a new xib and set the size of the view to "Form Sheet" it generates a waring:
Attribute Unavailable: Form Sheet simulated metrics are not available prior to Xcode 4.2.
I can fix the warning by changing the Document Version drop down in the property inspector to 4.2

You will have to modify directly the XCode templates :
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/File Templates/User Interface - Contains templates when you choose the menu File->New...->New File...
/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/User Interface - Contains templates when you choose the menu File->New...->New Project...
Edit the any xib you want by adding this inside <archive><data>:
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<real value="4200" key="NS.object.0"/>
</object>

Related

Unknown class [A Collection View Controller] in Interface Builder file

I wish to run iOS 6 programs on my iOS 5.1.1 iPad 1st generation, and all the UICollectionViews are all disappeared and debug console says
Unknown class collectionViewController in Interface Builder file
Is it because of incompatibility with UICollectionViews in iOS 5?
Correct. According to the documentation for the UICollectionView class, its availability is marked as "Available in iOS 6.0 and later." which means it does not exist in iOS 5.

how to add and edit 2 views in one view controller in xcode 4.2 from Interface Builder in iphone?

I am Abbas,I am new to iPhone Development,
Till tomorrow i am using xcode 3.2 sdk and build in interface builder,
I have updated my xcode to 4.2,
If i am adding another view to existing view controller by assigning IBOutlet View *view1,
and edit my new view from Interface Builder, it does not able to edit.
and also my previous Interface builder is not showing.
What i can do, Give me any suggestion,
Please Help me.
Thanks.
From xcode4, interface builder is integrated into xcode, it isn't a single UI any more.
You can easily edit it through just single click the .xib file. Maybe there is some wrong operation. I recommend you to close xcode3.2 and the project , then reopen the project only in xcode 4.2 .

Displaying XIB on UIView!How can i set it?

How can i display a XIB interface on an UIView!Please be simple!
a UIView interface built in a XIB can be displayed by linking that XIB with a UIViewController.
Check out the Apple documentation About Windows and Views.
And you can see how a XIB is set up just by creating a new project in XCode and choosing "Single View Application" as a template. If you're using XCode 4.2, the "MainStoryboard.storyboard" file appears to be the new name for a XIB file.
Which reminds me I should go check out the WWDC session online that talks about this -- and you should too. If you're a registered developer, it's free to check out! My educated guess is that the "Designing User Interfaces for iOS and Mac OS X Apps" session (at https://developer.apple.com/videos/wwdc/2011/?id=110) is the one you want to see.

Adding iPad XIB to a View Based Application Template Application in XCode 4

I've created a View Based Application in XCode4; when creating the application I selected iPhone as the Device Family:
The application was created with the following files:
I designed the UI on the TestushViewController.xib file and without adding any code in the Delegate files, the application is uploading immediately to the TestushViewController.xib view and I'm very happy about it.
Now I want to add an iPad xib. How do I do that?
(I knew how to do it in XCode 3, but I used some code in the Delegate file, and now if I try to use the same code it doesn't work because the template default implementation works differently - Apple uses #class TestushViewController and self.window.rootViewController = self.viewController and it goes directly to the iPhone.xib. I don't know how to go around it without changing the entire thing to the way it was done in XCode3)
You'll need to structure your code in a similar way that the Window Template does. The file structure that template uses when the "Universal" option is ticked at creation is:
App Name/
AppNameAppDelegate
iPhone/
AppNameAppDelegate_iPhone
MainWindow_iPhone.xib
iPad/
AppNameAppDelegate_iPad
MainWindow_iPad.xib
The iPhone and iPad AppDelegates are simply subclasses of the AppNameAppDelegate
#interface YourAppNameAppDelegate_iPhone : YourAppNameAppDelegate {}
In your target summary you can set what .xib file is initially loaded for each device. It is called the "Main Interface" and has a pulldown menu.
Quite frankly, if you're wanting to do a universal app (iPhone + iPad) it's probably easier just to start with the Window Template and add in your view controllers instead of starting with the View template and trying to change it up.

How to Apply Style to Iphone application

I like to have uniformity in my application style for my mobile.How to apply the styles to my control in the Iphone app ..Something similar to android resource files.. Even i hope thats one of the good pattern to follow in the application develovpment
Buttons can be styled by using
creating a custom button.
Custom views can be created using Interface builder or via code inheriting the UIview. A sample tutorial can be found here
You can create custom uitableview and uitableview cells too.
Resource files in android application is what Interface builder provides you in Xcode to create xib (nibs) for your ui layout.