Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:34:04+00:00 2026-06-15T11:34:04+00:00

I have created a new project in xcode 4.5 and I have called my

  • 0

I have created a new project in xcode 4.5 and I have called my viewcontroller by

-(id)initWithNibName:bundle:

from appdelegate as it called in default project template and i am not using storyboard
but awakeFromNib was not called
I have also searched but not able to understand why awakeFromNib is not calling.

By apple documentation for -(void)awakeFromNib
“Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.”
“Objects that conform to the NSCoding protocol (including all subclasses of UIView and UIViewController) are initialized
using their initWithCoder: method. All objects that do not conform
to the NSCoding protocol are initialized using their init method. After all objects have been instantiated and
initialized, the nib-loading code reestablishes the outlet and action connections for all of those objects. It then
calls the awakeFromNib method of the objects.”

My question is that Why awakeFromNib is not calling when xib file is loaded?
Is i am doing something wrong?Please elaborate

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:34:06+00:00Added an answer on June 15, 2026 at 11:34 am

    awakeFromNib: is called only if the view controller is inside the nib file.
    In this case you init the view controller with init initWithNibName:bundle, so the content of the view controller is inside the nib, not the view controller itself.
    If you open the xib file, drag an object inside the xib and set the class to be your view controller class name, then awakeFromNib will be called (this case you don’t need to initialize manually the view controller).
    So keep in mind the difference between having a view controller in a xib file, and having a view controller not in a xib file, but with all it’s contents loaded from a xib file.

    PS: I used nib and xib interchangeably.

    EDIT
    I forgot to tell you how to go around this.Override viewDidLoad to do things with the initialized outlets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a new project in XCode (using the template STL C++ library),
I have created a new Xcode project using Storyboards (tab view template). I added
I created a new cordova project on XCODE, I have some files that I
I have just created a new project in VS2010 using the Visual c# >
I have created an new Xcode project and trying to setup string localization. I
I have created a new project in Xcode and performed the following to add
I have created a new iPhone project in Xcode 4 and added some files
I created a project in xcode 4.2 using the feature of storyboard. I have
I have created an Xcode 4 project template for iOS that relies on several
i have one doubt,i have created new project in eclipse with android 2.3.1 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.