Questions tagged [awakefromnib]

awakeFromNib an Objective-C instance method which Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file

81 questions
1
vote
0 answers

Do windows get loaded differently from 10.10 -> 10.11?

We have a window we want to display, and in 10.11, it displays as we expect. we set all the properties of the views within the window in -windowDidLoad, and when the window is displayed, these buttons have the right colors: - (void)windowDidLoad { …
A O
  • 5,516
  • 3
  • 33
  • 68
1
vote
1 answer

What are outlets in awakeFromNib?

I see that when view controller is loaded from storyboard, these events happen in order awakeAfterUsingCoder awakeFromNib viewDidLoad In awakeFromNib, I see that isViewLoaded == false. From Which should I use, -awakeFromNib or…
onmyway133
  • 45,645
  • 31
  • 257
  • 263
1
vote
1 answer

Trying to set a property inside a UIView before awakeFromNib is called

Im new to swift - i have 2 viewcontrollers and a segue bitween them. im trying to set a property inside the view before it is loaded. so this is some of the code from my uiview - class ListUsersView: UIView { @IBOutlet var tableView:…
user2993422
  • 306
  • 2
  • 6
  • 22
1
vote
0 answers

Some IBOutlets are nil in view created using IB

I have created a view using IB in xib, loaded the view, and when I try to customize the containers (image, label, button e.t.c.) some containers are customized and some not. Like if I am setting the image on a image view it is getting set on the…
Sanjay Mohnani
  • 5,947
  • 30
  • 46
1
vote
1 answer

How do I get an objects height from awakeFromNib to my mainViewController.m?

I programmatically created a UILable in a xib file - class of awakeFromNib, and I'm trying to get the labels height in the mainViewController.m. I tried using an NSBundle to load the xib file, but it didn't work. Is there another way I should load…
user4487951
1
vote
1 answer

Position of Nib-loaded Subview incorrect in iOS 8

I have a custom class called CNJobMapView which is a subclass of UIView. This custom class loads a view from a nib file and adds it as a subview. I do this so that I can add a UIView object to a view in a storyboard, give it the CNJobMapView custom…
BreadicalMD
  • 336
  • 1
  • 16
1
vote
1 answer

awakeFromNib vs. initWithFrame for custome UITableViewCell

I need to make a custom UITableViewCell, so I created a subclass with associated nib file. I need to add some subviews to it. Does awakeFromNib replace initWithFrame when using a nib file? I am using [[NSBundle mainBundle] loadNibNamed: in my…
noobsmcgoobs
  • 2,716
  • 5
  • 32
  • 52
1
vote
0 answers

Setting IBOutlet properties on a custom view with a nib

I have a generic custom view that has a nib file. I subclass this custom view and initialize it like this: - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { NSArray *nibContents = [[NSBundle…
Darren
  • 10,091
  • 18
  • 65
  • 108
1
vote
1 answer

code inside awakeFromNib being overridden by the storyboard

I have the following code: - (void) awakeFromNib { CGRect temp = self.buttonOne.frame; temp.origin.y += 50; self.buttonOne.frame = temp; } The code inside is doing nothing; when the app loads buttonOne is exactly where it is on the…
Bassel
  • 452
  • 5
  • 21
1
vote
1 answer

App crash due to too long awakeFromNib

I'm creating a simple app on Xcode with the user interface including only one window that contains only 5 labels. I just want to show a few text in the labels using dates. I do all the work in the -awakeFromNib method. But when I build and run the…
0
votes
1 answer

Setting Delegate in awakeFromNib

I have a ViewController in Interface Builder that has a TableViewController embedded in it (I reuse the functionality of the TableViewController elsewhere). I need to set a delegate in the TabelViewController back to the UIViewController it is…
Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
0
votes
2 answers

Immediately starting new UIViewController from a viewcontroller

When the UIViewController starts, I want to start another UIViewController immediately. This doesn't work: -(void) awakeFromNib { UIViewController *newcontroller = [[[UIViewController alloc] init] autorelease]; ... [self…
blinsky
  • 3
  • 1
0
votes
1 answer

awakeFromNib got called twice for my WindowController, is that correct?

I was told that awakeFromNib should be called only once so I was quite surprised to see it was called twice for my WindowController. I use IB to create my WindowController in MainMenu.xib, but to tell it what window xib file to load I added an init…
Qiulang
  • 10,295
  • 11
  • 80
  • 129
0
votes
1 answer

Why does UITableviewCell UINib init crash

I am using UITableviewCell in view using UINib and adding it to contentView. I don't get any error when I debug or test from testflight but Crashlytics has a lot of crashes 0x102d20 std::__1::vector
OMANSAK
  • 1,066
  • 1
  • 12
  • 30
0
votes
2 answers

Inconsistent awakeFromNib behavior when adding NSToolbar

I am following a tutorial on creating a table view. It shows how to define two functions, numberOfRowsInTableView and viewForTableColumn, as well as wiring up the table to the AppDelegate (dataSource and delegate). The tutorial -- as written --…