Questions tagged [nib]

NIB files are similar to XIB files (XCode Interface Builder), with the difference being XIB files are modified during development and NIB files are created during the build process. NIBs store static information about the interface as well as any behavior that has been implemented.

Storyboards have since succeeded NIB/XIB files as the latest UI interface tool.

1152 questions
12
votes
1 answer

IBOutlets are nil on iOS 8 devices, but work fine on iOS 9 (Swift)

When running iOS 8, the IBOutlets of my nib based view controllers are nil, but when running iOS 9, they work fine. Any ideas why this might be happening? My app supports iOS 8+, and I'm running Xcode 7.2.
jjramos
  • 1,874
  • 14
  • 22
12
votes
1 answer

Loading a UIView subclass from NIB size issues

I have a subclass of UIView that needs to calculates it's height according to it's width. When created in code everything works. However when I try to create the view in Interface builder, and although I override all related methods, I can't get the…
Ron Srebro
  • 6,663
  • 3
  • 27
  • 40
12
votes
2 answers

Views are mirrored in RTL languages

When setting your device to a Right-To-Left language, iOS reverses the order of items. For example in a UITableViewCell set with Auto-Layout: I have an avatar image on the left and some text aligned right from it that fills up the rest of the cell.…
Jovan
  • 2,640
  • 2
  • 24
  • 34
11
votes
3 answers

If you have an IBOutlet, but not a property, is it retained or not?

I find the documentation on this issue to be unclear: Say you are working with iOS (NOT the Mac case, no need to mention the differences). Say it is strictly 4.0+ (no need to mention differences in old OS). Say we are loading the NIB strictly…
Fattie
  • 27,874
  • 70
  • 431
  • 719
11
votes
2 answers

User defined runtime attributes (IBInspectable) set after pre-defined attributes?

I am looking to add a new IBInspectable attribute (computed property) to UILabel via a category method. Ideally I want this attribute to be set after the labels text is set (via setValue:forKey), as this IBInspectable attribute may result in the the…
bencallis
  • 3,478
  • 4
  • 32
  • 58
11
votes
1 answer

Get Nib name/What exactly is a nib?

I'm trying to implement a page menu segue in my app using the pod from this pre-built page menu pod from github In the instructions, it says: var controller : UIViewController = UIViewController(nibName:"controllerNibName", bundle: nil) …
Michael Ninh
  • 772
  • 2
  • 10
  • 23
11
votes
1 answer

Error when validating iOS App

I am trying to publish an iOS application, however I receive these error when I try to validate my build: Nib file 'Main-iPad~.nib' was not found. Please ensure the specified file is included in the bundle with any required device modifiers appended…
B.I.A
  • 700
  • 1
  • 7
  • 20
10
votes
3 answers

Xcode "-[UIViewController _loadViewFromNibNamed:bundle:] loaded the nib but the view outlet was not set." error

I'm using Xcode 4 and when I run my app, the first screen doesn't load. It fails in the simulators and on a device. I've searched for answers and they all say to make sure I've dragged the circles in Files Owner to the correct views. Sorry I don't…
austin
  • 137
  • 1
  • 1
  • 5
10
votes
3 answers

Xcode 7.3 can't create xib with for UIView / UITableViewCell together

After I have updated to Xcode to 7.3, I found Xcode can't create Xib file, when I create UIView class or UITableViewCell. Does anybody know the reason?
yancey
  • 126
  • 1
  • 6
10
votes
1 answer

How to assign shortcuts to FileMerge

I know you can assign shortcuts by editing the nib file that FileMerge uses, but I have no idea how to do it. I want to replace the "choose left" and "choose right" actions with specific keys on my keyboard (for example, left key and right key). How…
itsmarziparzi
  • 699
  • 7
  • 21
10
votes
3 answers

Issues with AutoLayout with Custom Views defined in NIB file and used in StoryBoard

I've defined a custom view in a NIB file and would like to instantiate a copy in a StoryBoard but I'm having issues with autolayout. In a simple example, the custom view has single label with a fixed size and centered both vertically and…
mkrus
  • 825
  • 1
  • 8
  • 16
9
votes
1 answer

Convert NIB to XIB without Interface Builder

I've upgraded to XCode 4 and because IB is now inside none of my old NIB files will open getting a "An instance of ASKNibConnector could not be decoded" error. Is there a way to convert NIBs to XIBs without interface builder? or do you have to do…
Viking
  • 91
  • 1
  • 3
9
votes
2 answers

Handle orientation change on iPad with one UIViewController and two XIB

i'd like to handle orientation change on an iPad application with one UIViewController and two XIBs, let's say MenuView and MenuViewLandscape. So, in the willRotateToInterfaceOrientation method of the MenuViewController, how can i change XIB without…
Simone Margaritelli
  • 4,584
  • 10
  • 45
  • 70
9
votes
2 answers

Custom UIView with Nib in swift without using loadFromNib in the view controller

I've always used the loadNibNamed method for loading custom views into view controllers, but now i'm trying to avoid calling that method outside the custom view for making it more reusable so that if another person uses my custom view he only will…
diegomen
  • 1,804
  • 1
  • 23
  • 37
9
votes
4 answers

calling initWithNibName doesn't initialize items in the nib, it has 0x0

When I call: self.viewController = [[DidItViewController alloc] initWithNibName:@"DidItViewController" bundle:nil]; and then I check self.viewController.navController right after this line is executed in the debugger, I find that it's empty…
devinkb
  • 191
  • 1
  • 4