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
4
votes
1 answer

View of frame not appeared to have set in awakeFromNib

I am using autolayout in my view controller, to align a uiview as if it were a navigation bar (aligned to top, stretched to trailing and leading sides and 44 height). I have subclassed this view, and during awakeFromNib I want to add subviews to…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
3
votes
2 answers

Why is awakeFromNib being called twice when loading nib in nib?

I have two nibs: Parent.xib and Child.xib. I've included the Child nib inside the Parent nib to simplify binding. I set the subview programmatically in loadView. The problem is, awakeFromNib is getting called twice in Child's controller. I think I…
panupan
  • 1,212
  • 13
  • 15
2
votes
1 answer

Custom UILabel creation to avoid localization problems

Dear programmers, I am creating a customLabel class like below: @interface CustomLabel : UILabel { NSString *customBundlePath; } @implementation CustomLabel - (void)drawTextInRect:(CGRect)rect { NSString *result=[self…
Loquatious
  • 1,791
  • 12
  • 21
2
votes
2 answers

UIKit: call awakeFromNib programmatically?

I saw this code: CoolButton *coolButton = [[CoolButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 60.0f, 25.0f)]; [coolButton awakeFromNib]; // ... [coolButton release]; CoolButton subclasses UIButton. Is it OK to call awakeFromNib…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
2
votes
1 answer

Duplicate NSLog entries

I don't know if it's possible for me to include code here that's relevant as my project is so large but are there any typical reasons why NSLog would repeat some warnings and calls to it at occasions where only one call/error is occuring? As an…
biscuitstack
  • 11,591
  • 1
  • 26
  • 41
2
votes
1 answer

Variables is nil in awakeFromNib

I created a custom UIView that I instantiate with an object ConnectDetailItem. Code of my custom view : class InfosConnectView: UIView { var view: UIView! @IBOutlet weak var categorie: UILabel! @IBOutlet weak var distance: UILabel! …
BSK-Team
  • 1,750
  • 1
  • 19
  • 37
2
votes
1 answer

UIKit - awakeFromNib if not implemented

From Xcode 8 update it just noticed that, for UITableViewCell's awakeFromNib method with no content inside(automatically created while adding custom cell class with xib file), giving me the following warning. Method possibly missing a [super…
Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
2
votes
0 answers

Swift custom UIView IBOutlet nil , awakeFromNib() never called

I am trying to custom a UIView but when I call it, the outlets of custom view always nil, and awakeFromNib() never called, too. Here my CustomView: class DropdownMenuView: UIView { //MARK: Outlets @IBOutlet var view: DropdownMenuView! …
Ashley
  • 499
  • 1
  • 6
  • 15
2
votes
0 answers

awakeFromNib called continuously

I have a view based NSOutlineView within a NSView. When the view is presented in my app, the outlineview flicker's continuously. awakeFromNib is getting called repeatedly, which contains [myOutlineView reloadData]. However, once I resize the…
Cory
  • 2,302
  • 20
  • 33
1
vote
1 answer

adding subviews in awakeFromNib

Why does adding a subview in the awakeFromNib method cause it to go into a infinate loop? Where should subviews be added? thanks. - (void)awakeFromNib { outlineViewController = [[OutlineViewController alloc] initWithNibName:nil bundle:nil]; …
mfc
  • 3,018
  • 5
  • 31
  • 43
1
vote
1 answer

Need to make NSPopover appear during awakeFromNib?

I have a statusitem in the system menu bar that makes a popover appear when it is clicked. I would like to make the popover automatically appear when the application is first launched. I tried to add the [self clickStatusBar:self] to the…
wigging
  • 8,492
  • 12
  • 75
  • 117
1
vote
2 answers

Refactor the Application Delegate

I am a beginner to Obj-C and Xcode 4 and I am currently going through the "Your First Mac Application" on the Mac Dev website. I have managed to get through the main part but I'm struggling on the "Refactor the Application Delegate" section. I have…
1
vote
1 answer

Why is this View nil in awakeFromNib()?

I'm practicing awakeFromNib. I have a single UIView in Main.storyboard. This UIView inherit class CardView. Codes are below class ViewController: UIViewController { @IBOutlet weak var cardView: CardView! } And I have a CardView.xib. In,…
Hoo
  • 135
  • 13
1
vote
1 answer

Buildtime Canvas Pod xCode issue | missing a [super awakeFromNib] call || from CSAnimationView.m file

I just added the canvas pod (through cocoapods) and I can see the files in my workspace just fine, and I was able to "import Canvas" into my ViewController.swift. But I am getting a semantic build time error that the file CSAnimationView.m is…
elizabeth
  • 13
  • 3
1
vote
1 answer

How to reference a UICollectionView from other custom UICollectionViewCells

I have a UIViewController that has a UICollectionView with 4 custom cells. In one of the cells I have a UIButton that when tapped needs to access another one of the cells, to update an UIImage. How do I reference the collectionView reference in my…
Paul S.
  • 1,342
  • 4
  • 22
  • 43