3

I can't believe how much trouble I am having finding this:

I want to use NSLog()

what do I have to #import and what library do I link to?

thanks in advance,

Jay

ParkerHalo
  • 4,341
  • 9
  • 29
  • 51
jbww
  • 735
  • 2
  • 12
  • 27

3 Answers3

10

Go to http://developer.apple.com and in the search box type NSLog(). This takes you to the Foundation functions which documents this.

So the #import you are looking for is:

#import <Foundation/Foundation.h>

or, if you are on Xcode 5 and have module support turned on:

@import Foundation;
Abizern
  • 146,289
  • 39
  • 203
  • 257
4

NSLog is apart of the Foundation framework.

WrightsCS
  • 50,551
  • 22
  • 134
  • 186
2

Just like the rest of the NS classes and functions, you do not need to #import anything if you have the standard build setup such that the foundation classes are implicitly imported.

Hot Licks
  • 47,103
  • 17
  • 93
  • 151