1. Introduction to Objective-C in the early 1980 s, Brad indeed invented Objective-C in Stepstone. Objective-C is a programming language based on the C language that adds object-oriented features and expands. Currently, it is mainly used in MacOSX and iPhoneOs Systems Based on OpenStep. Objective-C can be compiled and executed in any system running GCC, because GCC itself contains
1. Introduction to Objective-C
In the early 1980 s, Brad indeed invented Objective-C in Stepstone. Objective-C is a programming language based on the C language that adds object-oriented features and expands. Currently, it is mainly used in two OpenStep systems, Mac OS x and iPhone OS. Objective-C can be compiled and executed in any system running GCC, because GCC itself contains the Objective-C compiler. [1]
2. Install the Objective-C Development Environment
Many of my friends know that developing Objective-C requires an Apple Mac machine (not an amazing startup !). It is unrealistic to buy an apple book (if the reader's financial ability permits it, let alone it .), What should I do? In Ubuntu 10.04, you can use GNUStep for Objective-C development. Use the new installation package manager to install the software. After the installation is started, enter gnustep-devel, right-click and mark the installation, and the system will prompt you to install the relevant dependent software package (which is easy to manage). Then, select and click the application, to install.
3. Compile an instance
After the installation is complete, you must compile an instance [from Wikipedia] for verification. The example is as follows:
# Import
Int main (int argc, char * argv []) {
NSAID utoreleasepool * pool = [[NSAID utoreleasepool alloc] init];
NSLog (@ "Hello World! ");
[Pool drain];
Return 0;
}
Use the gedit or vi editor to edit the preceding content and save it as hello. m.
Open the terminal and enter the hello. m directory. Run the following command to edit the program:
$ Gcc hello. m 'gnustep-config -- objc-flags '-lgnustep-base-o hello
Two files are generated in the current directory: hello. d And hello (executable file ).
Run the executable program:
$./Hello
11:37:39. 917 hello [5170] Hello World!
4. Objective-C learning materials
The Objective C Programming Language
Http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html
Objective C on Ubuntu
Http://www.excession.org.uk/blog/objective-c-on-ubuntu.html
Beginners Guide to Objective-C Programming
Http://gnustep.made-it.com/BG-objc/
References
1. Wikipedia http://zh.wikipedia.org/zh-cn/Objective-C.
2. Build the Object-C development environment in Ubuntu
Http://www.linuxidc.com/Linux/2010-08/28064.htm