第一次使用xcode,使用流程
图一:选择Create a new Xcode project
图二:选择Command Line Tol, Type choose Foundation
上面选择的是命令行工具,类型是函数类型,这样生成的代码是可以在命令行下执行的结构
main.m文件中的代码是
//--------------------------------------------
#import
int main (int argc, const char * argv[]) {
NSLog(@"Hello, Objective-C!");
return (0);
}
//--------------------------------------------
执行结果为
[Switching to process 612]
2011-04-07 12:54:17.060 Hello Objective-C[612:a0f] Hello, Objective-C!
Running…
Debugger stopped.
Program exited with status value:0.
//--------------------------------------------
工程文件结构:
Foundation.framework:
应用程序是在foudation.framework上被编译的
Hello Objective-C
terminal窗口,类似于Run->Control
Hello Objective-C.pch
.pch
文件类型:Precompiled Header File
扩展名为.pch的文件是一个开发文件。
文件说明:
Contains programming code referenced by a source code file, often using an #include preprocessor directive; may reference other header (.H) files and other resources.
PCH files are used by Microsoft Visual C++ and other software development programs, such as Apple Xcode; PCH files used by Xcode are called Prefix Header files and are typically named
Hello Objective-C.l文件是什么用处还不知道,看起来像是某种汇编语言之类的语法,可能是对整个工程的描述吧