[Tool] using sublime text development objective-c Preface
With the iphone hot, the objective-c used to develop the iphone app has slowly become one of the hottest programming languages. This article describes how to develop objective-c in the Windows operating system through the sublime Text tool, allowing developers who have no budget to purchase Mac devices to learn the syntax of OBJECTIVE-C. Keep a record for yourself, and hope to help developers in need.
Install Python
Before you can compile objective-c in the Windows operating system, you must install Python and then install GNUstep. The Python installer can be downloaded from the Python website.
Installing GNUstep
After loading python, install GNUstep, and then compile the objective-c through GNUstep. GNUstep installation program can be downloaded from the GNUstep official website, but in order to simplify the installation procedures, through the following URL to obtain the packaged GNUstep compressed file "gnustep.7z", directly unzip to C: The installation is completed.
- Https://github.com/sol-prog/ClangGNUstepobjective-cfor Windows
However, because the installation is done through GNUstep compressed files, it is necessary to manually "c:\gnustep\bin", "c:\gnustep\gnustep\system\ tools"these two gnustep paths into the Windows system variable path. ( remember to restart)
GNUstep after installation, you also need to "objective-c.gnustep-build.bat" the following files, add GNUstep directory path "c:\gnustep\msys\1.0\", Used to tell GNUstep how to compile objective-c.
- Click here to download: Objective-c.gnustep-build.bat
Install Sublime Text
After loading the GNUstep, and then installing sublime text, you can then compile the OBJECTIVE-C program code through sublime text. and sublime text installation program, can be downloaded from the sublime text website.
- http://www.sublimetext.com/
Sublime text after installation, you also need to "objective-c.sublime-build" the following files, add Sublime text directory path "c:\users\%username%\appdata\roaming\ Sublime text 2\packages\user", used to tell Sublime text to compile objective-c using GNUstep.
- Click here to download: Objective-c.sublime-build
Development Objective-c
After completing the installation steps, open sublime Text, enter the following OBJECTIVE-C program code, and save the file with the extension ".m". (The file path cannot contain Chinese )
#include <Foundation/Foundation.h>
int main(){
@autoreleasepool{
NSLog( @"\n\n Hello Objective-C by Clark \n\n");
}
return 0;
}
Then in the System menu "\tool\build system\", check the use of objective-c.
Later, you can compile and execute the OBJECTIVE-C by using the shortcut key "ctrl+b".
Reference data
Clang and objective-c on Windows-solarian Programmer
[Tool] using sublime text development objective-c