Nicholas Muir Nicholas Muir - 1 year ago 126
Objective-C Question

Objective C place NSString in NSLog

Really basic Obj C question:

before you say this is a duplicate I have already checked other answers and that is what I am using to do this with are saying to do it this way.

So I just want to output a NSString to NSLog but I am getting the error expected ")" on the log line.

I am obviously missing somthing really basic.

Here is the code:

// HelloWoldOBJ.m
// Helloworld2

#import "HelloWoldOBJ.h"

@implementation HelloWoldOBJ

NSString *make = @"porche";

NSLog(@"%@", make);


Thanks for your help

Answer Source

call your string in viewDidLoad and check

 - (void)viewDidLoad

[super viewDidLoad];

NSString *make = @"porche";

NSLog(@"%@", make);


you get the out put like

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download