顯示具有 Object-C 標籤的文章。 顯示所有文章
顯示具有 Object-C 標籤的文章。 顯示所有文章

2015/02/10

Swift 使用Google Maps SDK for IOS撰寫iPhone App

先下載Google Maps SDK for IOS並解壓縮,下載同時建立專案,並到Google Play Developer Console將Google Maps SDK for iOS功能開啟,建立一組IOS Key






Google Maps SDK for IOS解壓縮後會看到GoogleMaps-iOS-1.9.1資料夾,將『GoogleMaps.framework』和Resources資料夾內的『GoogleMaps.bundle』複製到專案的『Frameworks』資料夾(沒有Frameworks資料夾須自行建立)


『GoogleMaps.framework』複製到專案時,須將Copy Items if needed打勾,並選擇Create folder references

而『GoogleMaps.bundle』複製到專案時,不需將Copy Items if needed打勾,並選擇Create folder references




加入Objective-C Header,名稱隨意打,程式碼為
#import <GoogleMaps/GoogleMaps.h>


Swift 使用Objective-C Library 以Google Maps為例

Swift如果要調用Objective-C則可以在Swift Project內新增一個Objective-C的Header




2013/07/27

W7 撰寫 Objective-C

W7其實可以撰寫Objective-C的程式語言,只是必須下載類似gcc的編譯程式
這次我選擇使用GNUstep去編譯

先到GNUstep的Windows版本網址下載 MSYS、Core以及Devel
PackageRequired?StableUnstableNotes
GNUstep MSYS SystemRequired0.30.0-MSYS/MinGW System
GNUstep CoreRequired0.30.00.31.0GNUstep Core
GNUstep DevelOptional1.4.0-Developer Tools

安裝時必然要從MSYS、Core和Devel安裝過去

安裝完畢時,開啟GNUstep的shell,在這邊將分析Hello Objective-C這篇文章的程式碼儲存成Hello.m

在將Bash Shell Compiler Objective的Shell script儲存起來

接著我們透過Shell script去編譯剛剛寫好得Hell.m檔案

參考文章:
http://www.gnustep.org/experience/Windows.html

2012/11/15

Bash Shell Compiler Objective

懶惰,所以寫下這個Shell去編譯Objective-C
如果有人有需要歡迎索取


分析Hello Objective-C

這是今天參照Sample所寫的範例

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]){
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init];
        NSLog (@"Programming is fun!");
        [pool drain];
        return 0;
}

以下這行主要是保留一些記憶體空間給該程式
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init];

Fedora 安裝 Objective-C

先輸入以下指令:
yum install -y gcc gnustep* 

我們先將以下的code 存成Hello.m

#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]){
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc]init];
        NSLog (@"Programming is fun!");
        [pool drain];
        return 0;
}