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 100613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:36:46+00:00 2026-05-11T00:36:46+00:00

This should be straight forward for a guru. I don’t have any code really

  • 0

This should be straight forward for a guru. I don’t have any code really written out, just a couple of controllers and a custom UIView. All connected through nibs. The app loads without crashing, yet I can’t see my NSLog() hit from my custom UIView.

My application delegate has default template code which calls for a class of mine called TabAnimationController. TabAnimationViewController has its view set to TabView. I made sure that in TabAnimationViewController’s NIB that File’s owner is set to TabAnimationViewController and that my instance of UIView has its class set to TabView.

In TabView.m I’m trying to see how NSLog is going to hit, and it’s not showing up at all.

- (void)loadView {  NSLog(@'calling loadView'); }  - (id)initWithFrame:(CGRect)frame { NSLog(@'Calling initWithFrame:');     return self; } 

Strange. I’m not sure why even after proper IB connections that my NSLog will not show up. Only anything put into drawRect: will invoke. Why isn’t initWithFrame or loadView ever get hit? What if I want to customize this view programmatically?

  • 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. 2026-05-11T00:36:47+00:00Added an answer on May 11, 2026 at 12:36 am

    First of all, when a view is dehydrated from nib file, instead of initWithFrame, initWithCoder is invoked. So you need to implement your initialization in initWithCoder as well. (It may be a good idea to keep the initWithFrame initialization as well, if you anticipate programmatically creating your TabView instead of hooking up in the IB. Just refactor your initialization to another method and call it from both implementations.)

    Also in your initialization code above you must always call the super class’s initialization. There is a boiler plate pattern all custom classes use in their init implementation for that:

    if (self = [super initXXX]) { do your initialization }  return self; 

    Second, loadView which is actually a UIViewController method and not a UIView method is invoked only if the view outlet of the controller is nil.

    Unless you are composing your view yourself programmatically using your controller, you do not need to override loadView. Instead you should override viewDidLoad, which is called after the view is loaded, to do additional initialization.

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

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Do you want a single Repeater for all objects of… May 11, 2026 at 11:52 am
  • added an answer CACTI is very useful and highly configurable. Utilizes RRD Tool.… May 11, 2026 at 11:52 am
  • added an answer Chapter 11 (Inside Expression Trees) and chapter 12 (Extending Linq)… May 11, 2026 at 11:52 am

Related Questions

This should be straight forward for a guru. I don't have any code really
It seems like this should be straightforward but I'm boggling. I've got my listview
Shouldn't this be a pretty straightforward operation? However, I see there's neither a size()
This should be fine seeing as the CLR hasn't actually changed? The boxes running
This should be a really really simple thing, but for some reason it is
This should be easy for many of you, but for me it's just another
This should be easy, but I'm not sure how to best go about it.
This should be a simple question, but I haven't been able to find a
I think this should be easy, but it's evading me. I've got a many-to-many
I know this should be simple and I should know it but it's eluding

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.