where does nslog output go in xcode 4?

Discussion in 'iOS Programming' started by johnmerlino, Oct 26, 2011.

  1. johnmerlino macrumors member

    Oct 22, 2011
    hey all,

    In my iphone app, I have this line of code:

    - (void)viewDidUnload
        NSString* jsonString = @"{\"foo\": \"bar\"}";
        NSDictionary *resultsDictionary = [jsonString objectFromJSONString];
        NSLog(@"Dictionary value for \"foo\" is \"%@\"", [resultsDictionary objectForKey:@"foo"]);
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    I expect that NSLog entry to be output in console, but when I click "Show the Log Navigator" and click run, it just outputs this:

    GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
    Attaching to process 2014.
    Program ended with exit code: 0
    As you can see, my nslog was not output.

    thanks for response.
  2. KnightWRX macrumors Pentium


    Jan 28, 2009
    Quebec, Canada
    This is viewDidUnload, are you sure that method is being called ? Are you unloading your view ?

    Did you try putting NSLog() somewhere else ? It does output to the Console in Xcode 4, same as Xcode 3.
  3. johnmerlino thread starter macrumors member

    Oct 22, 2011
    thanks for response, I meant to put it in viewDidLoad. That was the problem.

Share This Page