Although java is used, we also know that obj-c is similar to java. Programming is similar to thinking.
However, the syntax of objective-c is weird and it still takes time to adapt. As I haven't bought a mac yet, I have set up an objective-c compiling environment in windows. Get used to it. Obj-c development.
To build an Objective C development environment in Windows, you need to download the three software packages from the GNUstep Official Website: GNUstep MSYS System, GNUstep Core, and GNUstep Devel. These three packages are required for obj-c development.
To put it bluntly, download the software package and click "Install". Note that you need to store the three packages in a folder. (I opened the three folders of the three installation packages in an error.
.).
Then, check whether the installation is successful and whether the Objective C code can be compiled successfully.
Compile an Objective C code to compile and run the test. Here we use the classic "hello world" to describe:
# Import <Foundation/Foundation. h>
Int main (int argc, const char * argv []) {
NSAID utoreleasepool * pool = [[NSAID utoreleasepool alloc] init];
NSLog (@ "Hello World! ");
[Pool drain];
Return 0;
}
Copy a Copy of the Code as follows: Put it in the E: \ objective-c \ gnu \ GNUstep \ home directory, helloworld. m
Then, click:
1. Start --- "program ---- GUNstep-à shell open a window: then enter
2. Use the command line to enter: E: \ objective-c \ gnu \ GNUstep \ home
3. write gcc-o helloworld. m-I/GNUstep/System/Library/Headers-fconstant-string-class = NSConstantString-L/GNUstep/System/Library/Libraries-lobjc-lgnustep-base
Pay attention to the red word, which is an uppercase word worth tens of millions of attention and is easy to confuse. I was delayed for a long time.
4. Write the./helloworld.exe file to get the hello world success.
5. Start obj-c Development
NND: it took a whole morning to get the environment ready. I didn't pay attention to some details. I am so confused... I have mentioned two details above. I hope the readers will notice that it will take at most 10 minutes to get it done, but it took me a few hours to read other people's blogs, which is not so detailed, the fatal point is not pointed out. It is harmful...