iPhone/iPad fatal error in C++ code produces no output in the log

Posted by morgancodes on Stack Overflow See other posts from Stack Overflow or by morgancodes
Published on 2011-01-07T03:46:01Z Indexed on 2011/01/07 3:53 UTC
Read the original article Hit count: 177

Filed under:
|
|
|
|

I'm trying to move away from Objective-C to C++ for audio in my iPad programming, due to the a few reports I've heard of Objective-C selectors sometimes causing audio glitches. So I'm starting to use pure C++ files.

When a fatal error happens in one of the C++ files, I get no output from the log. The app just crashes.

For example, if I do this in my C++ file:

    env = new ADSR();
    cout << "setting env to null\n";
    env = NULL;
    env->setSustainLevel(1);
    cout << "called function on non-initialized env\n";

I get the following output:

setting env to null

After that, there's a method called on NULL, which apparently kills the app, but absolutely nothing to that effect is reported. What do I need to do to have useful information logged when there's an error in my C++ code?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about c++