Objective-C ProgrammingIs the content to be introduced in this article, mainly introducesObjective-C Programming. Let's just look at the details.
- #import <Foundation/Foundation.h>
- int main(int argc,const char *argv[])
- {
- NSAutoreleasePool *pool = [[NSAutorelease Pool alloc] init];
- NSLog(@"Programmint is fun!");
- [pool drain];
- return 0;
- }
Output: Programming is fun!
1. Compile and run the program
You can use Xcode or the CNU Objective-C compiler to compile and run the program in the Terminal window.
1. Xcode
Xcode is located in the application sub-folder in the Develope folder,
2. Terminal
Developers who are used to using UNIX shells and command lines.
II,
1. In the OC language, note "//" and ""
2. # import: import or include the file information into the program.
3. Use [pool drain] to release the allocated memory pool and objects associated with the program ).
4. NSLog history is a function in the OC library, which only displays or records the parameter or parameter list ). Displays simple phrases, variable values, and variable results.
Summary: AnalysisObjective-C ProgrammingI hope this article will help you!