Questions tagged [loadnibnamed]

62 questions
0
votes
1 answer

LoadNibNamed doesn't set outlet

I'm trying to add an NSPopOver to my app but only load it when running 10.7 or later. I've put the popover, view controller & view in a separate xib and have loaded it with BOOL loaded = [NSBundle loadNibNamed:@"Popovers.xib" owner:self]; from…
Andy B
  • 1
  • 1
0
votes
1 answer

how to load nib files from different folders?

I'm trying to load NiB files from subfolders based on some condition at runtime. The problem is that the code is able to locate the NIB file when i call the method pathForResource but when i run the application i always get the following…
ArdenDev
  • 4,051
  • 5
  • 29
  • 50
0
votes
1 answer

Strong IBOutlet nil in XIB with multiple views

Calling Bundle.main.loadNibNamed to load a .xib file which contains (n) multiple variants of one UI defined with multiple UIViews instantiates n instances of my subclass. I then apply a filter expression to choose the correct variant with…
pinglock
  • 982
  • 2
  • 12
  • 30
0
votes
1 answer

problem loading view from nib file ,width of the view is 0.0

I'm trying to load nib file to view inside collectionViewController as parallax Header, but after loading the view the width of the view is 0.0 and it's not presenting.If I load any other view the width is ok but the width of this view changes to…
mzoko .T.K
  • 33
  • 5
0
votes
1 answer

How to load Custom Created view from XIB file and add to StackView

I have XIB file in which there is class of type UIView, and I wont to load that XIB in root ViewController: import UIKit class ViewController: UIViewController { // MARK: - Variables // MARK: - IBOutlets @IBOutlet private weak var mainStackView:…
0
votes
1 answer

Crash loadNibNamed (framework)

I created the framework and it crashes when I loadNibNamed. did not actually create the bundle file, and all the image and nib files are included in the framework. -(Qwerty *)getNibData { NSBundle *frameworkBundle = [NSBundle…
i like cat
  • 135
  • 8
0
votes
0 answers

IOS/Swift: optimal way to generate dozens of views from a NIB

Complete IOS newbie here... I'm writing a calendar app and trying to recreate this display: So I created a custom view, subclassing UIView. I pass this view an array of Appointment objects (my own custom objects), and for each one, I create a view…
user884248
  • 2,134
  • 3
  • 32
  • 57
0
votes
1 answer

Dynamically instantiating custom UIView's from XIB issue (what's wrong with this code)?

What is wrong with the following code, it's seems to have an endless loop. Initially comes through init:frame, to commonInit, but then the XIB loading line triggers entering again through init:coder etc. Two areas of question: a) How to instantiate…
Greg
  • 34,042
  • 79
  • 253
  • 454
0
votes
1 answer

Uibutton Actions not firing in ARC mode where As they are firing in non ARC mode

In View Controller.m @interface ViewController () { CustomView *view; } @implementation ViewController -(void)viewDidLoad { [super viewDidLoad]; view = nil; view = [[CustomView alloc]init]; [self.view addSubview:view]; } In…
siva krishna
  • 1,149
  • 2
  • 15
  • 23
0
votes
2 answers

Switched to swift 2.0 and getting AnyObject error

Why cam I getting the Cannot convert value of type [AnyObject]! to expected argument type. I am trying to load a nib into a view controller. func loadNibNamed(name: String!, owner: AnyObject!, options: [NSObject : AnyObject]!) -> [View1]!{ …
blee
  • 297
  • 4
  • 13
0
votes
1 answer

Swift custom control is not showing when being used in view controller (code attached)

When I try to use this custom control within my main view controller, by dragging a UIView onto screen in IB and setting it to "CustomerControlView", it doesn't actually show it. Question - What is wrong with the code I have here? Background -…
Greg
  • 34,042
  • 79
  • 253
  • 454
0
votes
1 answer

How to use NSBundle to load NIBs from downloaded bundle and fall back to main bundle

Here is the basic problem: I needed a view loading mechanism that attempts to create a view from a downloaded NIB in Documents, then falls back to the main bundle, if the view could not be created. I've gone through a lot of research and trial and…
Sheamus
  • 6,506
  • 3
  • 35
  • 61
0
votes
1 answer

Cocoa NSBundle loadNibNamed deprecated

I'm developing a Cocoa App and I noticed NSBundle loadNibNamed is deprecated. I'm trying to use a Sheet to show some config options. I'm using an AppController and the Config Sheet is a NIB created separately. This is my code. -…
hcontreras
  • 300
  • 2
  • 11
0
votes
2 answers

Storyboard add a custom view which has xib file has no subviews

I create a custom UIView A with a xib file and it can be loaded correctly by: NSArray *starsNib = [[NSBundle mainBundle] loadNibNamed:@"nibName" owner:nil options:nil]; A *starsView = starsNib[0]; [self.view addSubview:starsView]; Then…
scorpiozj
  • 2,687
  • 5
  • 34
  • 60
0
votes
0 answers

retain top level object loaded from nib

I have a menu that is shared by some viewControllers. To avoid duplication I gave the menu its own nib file. I load the menu with this code snippet. The menu is loaded from file, but is not retained. If I set the owner, the menu is retained but then…
user965972
  • 2,489
  • 2
  • 23
  • 39