Solved

Why doesn't breakpoint at local init() trigger in my UIViewController?

Posted on 2011-09-18
2
705 Views
Last Modified: 2016-02-10
I have an iPhone app up and running on a physical phone.

I have my own subclassed implementation of a UIViewController, with init() and viewDidLoad() overridden and declared like this:

- (id)init;
- (void)viewDidLoad;

When I set breakpoints at init() and viewDidLoad() and run the app, gdb breaks at viewDidLoad(), but not init().  init() appears not to be called at all.  In fact, farther down in the execution, variables that are supposed to be assigned in init() are still unassigned.

Any thoughts?  Explanations?

- Thanks
0
Comment
Question by:CBueche
2 Comments
 
LVL 5

Accepted Solution

by:
mad_mac earned 125 total points
ID: 36558963
2 things could be a factor here

1.  Are you programatically creating the view controller subclass or is it an object referenced from a XIB (NIB)..?  If it's the latter then you should be using -awakeFromNib to initialise variables.

2.  Normally a plain old init is not called, usually it is initWithNibName:bundle:

0
 
LVL 1

Author Comment

by:CBueche
ID: 36563022
That sounds like the problem.  No time to verify right now, but I am in fact calling it up from a XIB.

Thanks!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

What's a UDID? If you're involved in developing, testing, or even reviewing an iOS application that's in beta, then at some point you may need to know the UDID for any iOS devices that you'll be testing on. What's the UDID? It stands for Unique Dev…
There is a security feature on iOS devices that is nearly impenetrable when it has been activated.  This article will provide some possible solutions as well as necessary steps to take to ensure you do not end up with a locked device.
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now