user559142
user559142

Reputation: 12517

Print NSString Argument using NSLog

-(void) postToDB:(NSString*) msg{
    //print msg
    NSString *myphp = @"/Applications/MAMP/htdocs/databases/test.php";
    NSURL *url = [NSURL URLWithString:myphp];
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
    [request setPostValue:msg forKey:@"message"];
}

In the above method, how can I print 'msg' using NSLog?

Many thanks

Upvotes: 27

Views: 40838

Answers (3)

thbourlove
thbourlove

Reputation: 31

You will like this:

#define CNMLog(msg) NSLog(@"%@", msg)
CNMLog(msg);

Upvotes: 3

Mehul Mistri
Mehul Mistri

Reputation: 15147

Using This

NSLog(@"Message == %@",msg);

Upvotes: 8

Praveen S
Praveen S

Reputation: 10393

NSLog(@"%@",msg); its of type NSString.

Upvotes: 60

Related Questions