Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

johnmerlino

macrumors member
Original poster
Oct 22, 2011
81
0
hey all,

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

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:

Code:
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.
kill
quit
Program ended with exit code: 0

As you can see, my nslog was not output.

thanks for response.
 
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.
 
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.

thanks for response, I meant to put it in viewDidLoad. That was the problem.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.