In C if we include #stdio.h we get some functions like printf, scanf. In the same way for Objective C what we should do to include NSLog,NSArray,… and where the definitions of these NSLog, NSArray are stored ? Please clarify my confusion.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Adding to what jib wrote: to use those functions, one puts a line
at the top of the source code. This corresponds to
#include <stdio.h>in the standard C.In OS X,
reads the header file at
FirstPart.frameworksomewhere in the framework search path (typically,/System/Library/Frameworks) and then theSecondPart.his looked up insideFirstPart.framework/Headers/. So, in the case of#import <Foundation/Foundation.h>, the file is at/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h. Now, if you open that file, you see it just have lots of other#import‘s, as in :and the real definitions are in those files. In general, you shouldn’t import those individual headers, but should just import the main header (in this case
Foundation/Foundation.h); the compiler has an optimization which makes it faster that way.