跳到主要內容

文章

目前顯示的是 十二月, 2016的文章

[iOS] build universal library

1.「Product」->「Scheme」->「Edit Scheme」,切到「Run」分頁,將「Build Configuration」切換為「Release」。 2a. 分別build出simulator lib and iphone lib,再執行合併程式 lipo -create $(PATH_TO_libMZKit-iphonesimulator.a) $(PATH_TO_libMZKit-iphoneos.a) -output libMZKit.a 2a. Add Run Script # define output folder environment variable UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal Step 1. Build Device and Simulator versions xcodebuild -target TargetName ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" xcodebuild -target TargetName ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" make sure the output directory exists mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" Step 2. Create universal binary file using lipolipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a" "${BUILD_DIR}/${CONFIG

[Xcode] include library project

1 Add new Target setting to your Podfile 2 Run pod install, then new thing will appear in the left view of Xcode 3 Setting Link Binary With Libraries 4 Setting Copy Bundle Resources 5 Setting User Header Search Paths in Build Settings 6 target的build settings, 把「Generate Debug Symbol」設成「YES」。 把「Strip Debug Symbols During Copy」設成「NO」。

Google Sheets

1. 將某一欄位的值產生出類似key=value的效果 // AA -> “AA”=“AA”; ="""" & A2 & """=""" & A2 & """;" Google 試算表函式清單 https://support.google.com/docs/table/25273?hl=zh-Hant Google Apps Script https://developers.google.com/apps-script/ Extending Google Sheets https://developers.google.com/apps-script/guides/sheets http://jamestw.logdown.com/posts/517286-google-apps-script 原來Google雲端硬碟也能開放「匿名上傳」,做為學生作業、比賽稿件上傳就不用再傷腦筋了!(Google Apps Script應用服務指令碼) http://harmonica80.blogspot.tw/2015/08/googlegoogle-apps-script.html 這是利用Python 價格追蹤:使用 gspread 自動更新 Google Sheets http://city.shaform.com/blog/2016/03/19/gspread.html

[iOS] Enum

Objective-C //NS_ENUM,定義狀態等普通枚舉 typedef NS_ENUM(NSUInteger, TTGState) { TTGStateOK = 0, TTGStateError, TTGStateUnknow }; //NS_OPTIONS,定義選項 typedef NS_OPTIONS(NSUInteger, TTGDirection) { TTGDirectionNone = 0, TTGDirectionTop = 1 << 0, TTGDirectionLeft = 1 << 1, TTGDirectionRight = 1 << 2, TTGDirectionBottom = 1 << 3 }; 參考 http://blog.csdn.net/annkie/article/details/9877643 Swift //簡易定義:首字母大寫 enum Color { case blue case red case green case gray case white case black } //複雜定義 enum ColorWithDesc:String { case blue = "藍色" case red = "紅色" case green = "綠色" case gray = "灰色" case white = "白色" case black = "黑色" } 參考 http://www.99ios.com/index.php/archives/3153/

[iOS] 產生iOS Documents - 使用Doxygen

使用Doxygen: 安裝 from: http://www.stack.nl/~dimitri/doxygen/download.html If you have GIT installed, you should do the following to get the initial copy of the repository: git clone https://github.com/doxygen/doxygen.git cd doxygen After that you can use mkdir build cd build cmake -G "Unix Makefiles" .. make To force a fresh build after an earlier check-out simple remove the build directory and redo the steps above. After the binaries have been built, you can use make install to install them. 使用 1 產生設定檔 doxygen -g ProjectNameConfig 2 修改設定 PROJECT_NAME = OpenCV 2.4.9 # 改成自己要的專案名字 PROJECT_NUMBER = 1.0 # 專案的版本 OUTPUT_DIRECTORY = ../docs/OpenCV2.4.9 # 輸出的位置 INPUT = /usr/local/Cellar/opencv/2.4.9 # 讀取的位置 CREATE_SUBDIRS = YES OUTPUT_LANGUAGE = Chinese-Traditional FULL_PATH_NAMES = NO EXTRACT_STATIC = YES FILE_PATTERNS = *.h *.m *.swift #讀進的副檔名, 不需要逗號 RECURSIVE = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES INLINE_SOURCE = YES EXTRACT_ALL = YES 3 支援繪圖 安裝Graph

[iOS] 取得sim卡資訊

CTTelephonyNetworkInfo *networkInfo = [CTTelephonyNetworkInfo new]; CTCarrier *carrier = [networkInfo subscriberCellularProvider]; //detect sim card status [networkInfo setSubscriberCellularProviderDidUpdateNotifier:^(CTCarrier* carrier) { NSString *countryCode = carrier.mobileCountryCode; NSString *networkCode = carrier.mobileNetworkCode; }];