Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

new xib in xcode4

Tags:

iphone

xib

ipad

nib

I develped an iPhone app. Now i would like to do it in iPad. To do this I have to create the new .XIB files and linked to his Class.

I don't know how to create a new .xib in xcode4. Could somebody help me?

Now, to solve this problem, I create a new file with his .XIB, delete the .m & .h and link the .XIB with my class.

Thanyou.

like image 333
ValentiGoClimb Avatar asked May 17 '11 09:05

ValentiGoClimb


People also ask

How do I add XIB in Objective C?

Create new “View” file from the User Interface menu. This will be your xib that represents a person in your app (let's say it's a dating app). Call it “PersonXIB” (or whatever you want). You're going to see what looks very much like a single view storyboard file with a blank view.

What is XIB file in iOS?

XIBs are a newer, XML based format that is used for the UI at design time. When you compile your app, the XIB files are converted to binary NIB files for you, and those binary versions of the files are embedded into your app.


2 Answers

In order to create a XIB file in XCode 4, just go to the main menu, File->New->New File..., and from there choose User Interface from the iOS section. Then choose View (if that's what you want), device family and finally save.

Hope it helps.

like image 99
msoler Avatar answered Oct 06 '22 13:10

msoler


We also need two more nib files, one for each of the two content views we just created. To create these, single-click the Resources folder in the Groups & Files pane so that we create them in the correct place, and then press ␣N or select New File... from the File menu again. This time, when the assistant window comes up, select User Interfaces under the iPhone OS heading in the left pane .

Select the icon for the View XIB template, which will create a nib with a content view, and then click the Next button. When prompted for a filename, type BlueView.xib. Repeat the steps to create a second nib file called YellowView.xib. Once you’ve done that, you have all the files you need. It’s time to start hooking everything together.

like image 39
rptwsthi Avatar answered Oct 06 '22 12:10

rptwsthi