Questions tagged [xib]

XIB is the file format for Interface Builder, which is a development tool for the Mac OS X & iOS platforms.

is a software development application for Apple's Mac operating system. It is part of (formerly Project Builder), the Apple Developer Connection developer's toolset. Interface Builder allows and Carbon developers to create interfaces for applications using a graphical user interface. The resulting interface is stored as a .nib file, short for NeXT Interface Builder, or more recently, as a .xib () file.

Interface Builder is descended from the NeXTSTEP development software of the same name. A version of Interface Builder is also used in the development of OpenStep software, and a very similar tool called Gorm exists for GNUstep. On March 27, 2008, a specialized iPhone version of Interface Builder allowing interface construction for iPhone applications was released with the iPhone SDK Beta 2. As of Xcode 4, Interface Builder no longer exists as a separate application, and its functionality is directly integrated into Xcode.

The Interface Builder editor within Xcode makes it simple to design a full user interface without writing any code. Simply drag and drop windows, buttons, text fields, and other objects onto the design canvas to create a functioning Mac, iPhone, or iPad user interface.

Because Cocoa and Cocoa Touch are built using the Model-View-Controller pattern, it is easy to independently design your interfaces, separate from their implementations. User interfaces are actually archived Cocoa or Cocoa Touch objects (saved as .nib files), and OS X and iOS will dynamically create the connection between UI and code when the app is run.

Resources:

3016 questions
45
votes
5 answers

How to add new xib files

I have to develop an app with multiple screens. I have automatically generated xib file, but for my other screen I need another xib file. How do I create another xib file?
ilaunchpad
  • 1,283
  • 3
  • 16
  • 32
45
votes
8 answers

Xcode 4.5 corrupting XIBs?

i am using the new xcode 4.5, i have this lines of code on some view controller: DiscoverCell* cell=[table dequeueReusableCellWithIdentifier:@"DiscoverCell"]; if(cell==nil){ NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"DiscoverCell" …
Dima
  • 8,586
  • 4
  • 28
  • 57
41
votes
3 answers

How to duplicate a .xib file?

I see there's no "duplicate" when I right click on a .xib. So is the way to do it: just to go to finder, copy the file to another name, and then drag it to my resources? Would that be all I'd need to do? [Note: just wondering if there's other files…
Shai UI
  • 50,568
  • 73
  • 204
  • 309
41
votes
8 answers

Alternative iOS layouts for portrait and landscape using just one .xib file

Using interface builder in xcode and just one .xib file, how can I create alternate layouts when rotating between landscape and portrait orientations? See diagram of differing layouts N.b. the green view/area would contain 3 items flowing…
Dave Haigh
  • 4,369
  • 5
  • 34
  • 56
38
votes
5 answers

Which is more efficient way? StoryBoard or XIB?

My question is slightly different then my title suggest. I have worked with xib. Now i am trying to work with storyboard. My question is if we are navigate through one class from another class, is StoryBoard giving benefit for better memory…
Vishal Sharma
  • 1,733
  • 2
  • 12
  • 32
38
votes
2 answers

How to disable Interface Builder document versioning from auto updating?

This question is still getting a lot of upvotes. So look at Update3. once you have upvoted, commented, answered, please please please file a radar Viewing a nib / xib, modifies the file, forcing me to either commit the change or undo the change.…
Nitin Alabur
  • 5,812
  • 1
  • 34
  • 52
37
votes
5 answers

UIViewControllerHierarchyInconsistency when trying to present a modal view controller

Trying to present a modal view controller with the following code MapViewController *mapView = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil]; mapView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; …
Sam J.
  • 685
  • 1
  • 8
  • 22
35
votes
4 answers

How to open a new window on button click in Cocoa Mac Application?

I want to know how to open a new window on button click in Cocoa Mac Programming. Help me. I am doing a mac application which needs to open a new mac window on particular button click.
ShinuShajahan
  • 1,296
  • 2
  • 11
  • 20
35
votes
5 answers

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

I have an application in which I would like to support multiple orientations. I have two .xib files that I want to use, myViewController.xib and myViewControllerLandscape.xib. myViewController.xib exists in project/Resources and…
Peter Hajas
  • 4,011
  • 4
  • 25
  • 28
34
votes
8 answers

XIB File opens like an XML in XCode but opens correctly with Interface Builder

When I double-click my file StartWindow.xib in Xcode 4, it does not open into the integrated Interface Builder; it opens like a XML file. I can open all other xib files and they display as expected. I can open it with the old Interface Builder via…
mabstrei
  • 1,200
  • 3
  • 13
  • 28
34
votes
4 answers

Execute code in Launch Screen

Xcode allows to create launch screen in .xib files via Interface Builder. Is it possible to execute some code with the xib, just like in usual view controllers? It would be great if we can set different text/images/etc while app launching.
Dmitriy
  • 1,898
  • 1
  • 15
  • 24
34
votes
8 answers

Couldn't open xib file after git pull, invalid element name

I am working on project with another developer. We are working on bitbucket. The problem is he made a changes in XIB files. After that when I do a git pull, I receive the changes but get an error on XIB files. When I tried to open it, a show alert…
Atef
  • 2,872
  • 1
  • 36
  • 32
33
votes
1 answer

How To: Self-Sizing Custom-View from XIB with StackView View in iOS

I've recently started diving into iOS development with Swift again and am now looking into a custom UIControl. For layout and flexibility this custom view is built using a StackView. What I want to achieve ... ... is basically to simply have the…
martin
  • 591
  • 1
  • 8
  • 17
31
votes
6 answers

Can you reference Xib files from static libraries on the iPhone?

In my app, i currently have all my code separated into a static library, to make it easier to set up the xcode project targets for the actual app and for unit tests for my code. The problem with this is that i want to put most of my xib files in…
Kevlar
  • 8,804
  • 9
  • 55
  • 81
29
votes
4 answers

How to link a .xib file to a class file with Xcode 4

have started a universal project under the new Xcode4. My Application works on both iPhone & iPad devices but not well design for the iPad. I have 2 .xib file for the MainWindow: MainWindow.xib (iPhone device) & MainWindow-Ipad.xib (iPad device).…
user763308
  • 435
  • 2
  • 5
  • 10