質問

Can I add NSLog in my model class's implementation. So when I call that method where I have inserted NSLog , from the controller , I should get the strings from that NSLog on my console.

Can I do that ? I tried doing it in my code but I am not sure if it should work or not.

役に立ちましたか?

解決

You can put NSLog wherever you like. It's a macro.

他のヒント

It can be used anywhere, without a doubt.

NSLog() is an extended printf() for Objective-C.Its is a Foundation function, accepting a constant NSString as format, having extended format specifier set. It also prints the process name and date before it prints the actual format and writes to sdterr.

You could. But its unnecessary to have a method just for NSLog.

-(void)print:(NSString * )text{
  NSLog("%@", text);
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top