27
-(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

user559142
  • 12,279
  • 49
  • 116
  • 179

3 Answers3

58

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

Praveen S
  • 10,355
  • 2
  • 43
  • 69
8

Using This

NSLog(@"Message == %@",msg);
Mehul Mistri
  • 15,037
  • 14
  • 70
  • 94
3

You will like this:

#define CNMLog(msg) NSLog(@"%@", msg)
CNMLog(msg);
thbourlove
  • 31
  • 2