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

Objective-C initialization in awakeFromNib seems not working

Initializing in awakeFromNib seems not working. I have PBManager.m and In ViewController.m I made property for PBManager like @interface ViewController : UIViewController @property (strong, nonatomic) PBManager * pbMgr; @end And tried to…
Hwangho Kim
  • 629
  • 4
  • 20
0
votes
1 answer

Initialising view controller with IBOutlets to custom views

I am trying to find a way to initialise a view controller which has IBOutlets to a custom view that I have created in a XIB. Here is the code where I initialise my class: MyContentViewController *pageContentViewController = [[MyContentViewController…
pls
  • 1,522
  • 2
  • 21
  • 41
0
votes
1 answer

Call DataSource method in awakeFromNib

So the question is like this: I subclass 2 classes, which is UIView(name: Menu) and UIViewController(name: MainController). In Menu, i used xib file to create it layout. In MainController, i added Menu as subview like this and comform to protocol in…
tan
  • 97
  • 1
  • 9
0
votes
1 answer

Calling awakeFromNib from xib file in the main ViewController

I have a custom cell in a UITableView using an xib file. I programatically created a UILabel with a height of 200 and a width of 50. When I do an NSLog in the customCell.m of the label's width and height, it gives me w: 50 and h: 200. But when I do…
user4487951
0
votes
1 answer

how to recall awakefromnib

I would like to fetch each control such as UIButton/UILabel/UITextField when the .xib is going to show.And I know I can do it in awakefromnib,but How can I make awakefromnib be called again AUTOMATICALLY.Thanks! actually,I goal is to localize .xib…
0
votes
2 answers

Displaying an alert view similar to UIAlertView

I am trying to create a custom "alert view", nothing too fancy I just want to display a view overtop of the current view just like a UIAlertView. Now here is the problem...I made the view in a nib file and now I want to alloc/init the view whenever…
DBoyer
  • 3,062
  • 4
  • 22
  • 32
0
votes
0 answers

How to update label (NSTextfield) without IBAction?

I’m trying to implement а simple mechanic: after draging а file, pass it’s name to lable. But I couldn’t understand how to do this. Here is my code: H file: #import @interface DropView : NSView {} …
0
votes
1 answer

Why is the NSStatusItem displaying multiple times?

A NSStatusItem has a NSMenu attached, and one of the buttons of the NSMenu opens a NSWindow. Whenever one of these buttons is clicked, the window opens as expected and works properly, but another display of the NSStatusItem is opened. The…
Eliza Wilson
  • 1,031
  • 1
  • 13
  • 38
0
votes
1 answer

Objective-C: Localization in an Efficient Way

I've been localizing my programs by creating strings file and/or localized xib files for every language. This process is very slow since it's complex to maintain all the localized xib files and add new features to the interface. To avoid this, in my…
TCB13
  • 3,067
  • 2
  • 39
  • 68
0
votes
1 answer

Is it possible to a property in a container view before awakeFromNib is called?

I have a container view that holds a view controller. I need to set a non-UI property in this view controller before awakeFromNib is called. However, the prepareForSegue method for the embed segue isn't called until after awakeFromNib happens. …
Aaron Brown
  • 407
  • 4
  • 17
0
votes
1 answer

Pause and resume repeatable NSTimer when closing and opening window

Now I know there are questions on SO about NSTimer pause, but none on repeatable and closing/opening windows. Toggeling pause works perfect (checked using button). Reopening window gives BAD_ACCESS error. - (void)awakeFromNib { self.timer =…
0
votes
1 answer

Setting the properties of items in an customview in iOS

I am creating a customView and for example, would like to set the text color of the label and initialise the text of the label. The initWithFrame is the generic function. - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; …
lakshmen
  • 28,346
  • 66
  • 178
  • 276
0
votes
1 answer

Initialising custom control both programmatically and from NIB

I am writing a custom UI control, and am curious as to the standard practices around initialisation (particularly dependance on the control's delegate). Like most controls, my control relies on the delegate to provide important information about…
Craig Edwards
  • 2,118
  • 1
  • 18
  • 23
0
votes
1 answer

What functions are called between subview's awakeFromNib and view's viewDidLoad?

I have a UIView/UIViewController (UIViewController) within storyboard that contains a custom UIView (CustomView) that has an associated .xib file. I am encountering the following phenomenon when I load UIViewController: CustomView's awakeFromNib…
0
votes
1 answer

awakeFromNib can't get value from UILabel and can't disable UIButton

I have two buttons in single-view app main storyboard and would like to disable one of them as well as get value from the UILabel using awakeFromNib method. As far as I concern all relationships and GUI items must be initialized and values must be…
Max P
  • 25
  • 6