1

I follow official Apple's documentation but i don't seem any relevant answer to my question.

NSLog VS NSLogv
Deepak Kumar
  • 1,035
  • 10
  • 18

2 Answers2

0

no difference , NSLog called NSLogv with parameter . So if you user NSLog with some parameter , NSLog Re-called NSLogv Function.

0

There's a variant of NSLog that accepts a va_list called NSLogv:

- (void) log:(NSString *)text, ... {
  va_list args;
  va_start(args, text);
  NSLogv(text, args);
  va_end(args);
}

The only way to forward the actual ... (not the va_list) is to use a macro. For example:

#define MyLog(f, ...) { \
NSLog(f, ##__VA_ARGS__); \
[someObject doSomething:f, ##__VA_ARGS__]; \
}
Moin Shirazi
  • 4,372
  • 2
  • 26
  • 38