Search code examples
objective-cxcodenslog

Xcode console does not show NSLog output, only (lldb)


I am trying to run the following in Xcode:

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {

//        NSLog(@"Hello, my name is Travis");
//        NSString *firstName = @"Variable";
//        NSLog(@"Hello, my name is %@", firstName);
//        NSString *lastName = @"Last Name";
//        NSLog((@"First name: %@, Last name: %@", firstName, lastName));
//        NSNumber *age = @26;
//        NSLog(@"%@ age is %@", firstName, age);
//        NSArray *items = @[@"item1", @"item2", @"item3"];
//        NSLog(@"%@",items[1]);
//        NSLog(@"%@", [items description]);
//        NSString *result = [items description];
//        NSLog(result);
        NSString *city = @"San Francisco";
        NSUInteger cityLength = [city length];
        NSLog(@"%lu", cityLength);
//        NSMutableArray *mystr = [NSMutableArray arrayWithObjects:@"hello",@"world", nil];
//        NSLog(@"%@", mystr[0]);
//        NSString *me = @"FROM ME!";
//        [mystr addObject: me];
//        NSLog(@"%@", mystr[2]);
//        NSDictionary *appRatings = @{@"item1": @4, @"item2": @3};
//        NSLog(@"%@", [appRatings allKeys]);
//        NSLog(@"%@", [appRatings objectForKey:@"item1"]);
//        NSLog(@"%@", [appRatings allValues]);
//        NSLog(@"%@", [appRatings valueForKey:@4]);

    }

}  

I'm simply trying to run the code thats uncommented. Seems simple, should just count the number of characters within my string variable. When I run this, the build succeeds but nothing is put into the console. The only thing that appears is: (lldb)


Solution

  • The lldb means the code is paused somewhere at a breakpoint, and is waiting for a lldb command. Either disable breakpoints or find and remove them, and try again.