Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-18
2
Medium Priority
?
809 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
mad_mac earned 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
I recently went through the process of creating an installable image of an iPhone mobile app (an .ipa file) that beta testers could load onto their test devices. The process involved quite a few steps, but both Appcelerator and Diawi.org had decent …
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 how to use strings and some functions related to them in the C programming language.

704 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