跳到主要內容

文章

目前顯示的是 十月, 2015的文章

[TroubleShooting] ITMS-90096

                      今天在打包APP上傳時,發生了這錯誤 網路上查了一下,都說這是Launch Screen的問題 說要放置Default-568h@2x.png這個檔案 但我的LaunchScreen的圖並不是全螢幕的,只是一張置中的小圖 最後發現是我在LaunchScreen.xib裡面,直接拉了一張圖進去 而不是使用image view! 修正為使用image view,再將圖設定進image view後就可上傳成功了!

[iOS] iPhone 尺寸圖

[iOS] Share Screenshot to Facebook

如何將手機螢幕截圖分享到臉書︰   設定Navigation Bar按鈕 - (void)viewDidLoad { UIBarButtonItem *shareBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(saveScreenshotToPhotosAlbum:)]; //[self.navigationItem setRightBarButtonItem:shareBtn]; [self.navigationItem setRightBarButtonItems:[self.navigationItem.rightBarButtonItems arrayByAddingObject:shareBtn]]; }   按鈕事件 - (void)saveScreenshotToPhotosAlbum:(UIView *)view { if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]){ self.mySLComposerSheet = [[SLComposeViewController alloc] init]; self.mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; [self.mySLComposerSheet setInitialText:@"Some Text"]; [self.mySLComposerSheet addImage:[self captureView:self.view]]; [self presentViewController:self.mySLComposerSheet animated:YES completion:nil

[iOS] 好用的3rd-party libraries

  Label跑馬燈: https://github.com/cbpowell/MarqueeLabel   HTML/XML Parser相關: 以前用apple,今天看到一個叫Ji的,試用先! https://github.com/honghaoz/Ji   Logger相關: https://github.com/DaveWoodCom/XCGLogger   AutoLayout相關 SnapKit: https://github.com/SnapKit/SnapKit https://github.com/SnapKit/SnapKit

[TestNG] - testng.xml

Testing.xml 的主要結構 根標籤是<suite> <suite> 標籤包含一個或多個<test> 標籤 <test> 標籤包含一個或多個<classes> 標籤 <classes> 標籤包含一個或多個<method> 標籤 一般來說,大多數文件詳細到<classes> 標籤即可。 Testing.xml 的額外標籤 <packages> 和<package> :顧名思義,它們可以指定一組java 包,在這個標籤中還可以用包含<include> 或者排除<exclude> 屬性。 <parameter> 定義了參數名稱和值,它的使用是與測試類當中@Parameters 的註釋結合使用的,作用和@Dataprovider 類似,提供外部參數,功能不如@Dataprovider 強大,有局限性。 <suite-files> 和<suite-file> :它是用來引入其他testng.xml 文件的,這些文件將於當前文件一起執行。 <groups> ,<define> 和<run> :這三個標籤結合使用,在執行時用來指定或者排除一部分的分組   注意執行測試的默認順序是按照testng.xml 裡給定的順序執行的。如果你不希望按此順序執行,請使用preserve-order 屬性指定為false。如<test name="Regression1" preserve-order="false"> 。   參考︰ 單元測試框架TestNg使用總結  http://nighthawk.iteye.com/blog/1502482

[Swift] 取得目前使用的語系

  // 取得目前語系環境 let userDefaults: NSUserDefaults = NSUserDefaults.standardUserDefaults() let aray: NSArray = userDefaults.objectForKey("AppleLanguages") as! NSArray let currentLanguage = aray.objectAtIndex(0) print("Current language: \(currentLanguage)") let locale = NSLocale.currentLocale() let trans = locale.displayNameForKey(NSLocaleIdentifier, value: currentLanguage) print("Localized display name: \(trans!)") Console output: Current language: en-TW Localized display name: English (Taiwan)

[Swift] UIView Shadow

為UIView加上陰影 backView.layer.shadowOffset = CGSize(width: 3, height: 3) backView.layer.shadowOpacity = 0.7 backView.layer.shadowRadius = 2 backView.layer.shadowColor = UIColor(hexString: "#3A4355")!.CGColor 參考︰ Shadow effect in swift on UIView http://gracefullycoded.com/shadow-effect-in-swift-on-uiview-uilabels/ Playing with UIView shadows in Swift http://mookid.dk/oncode/archives/3780

[Java] gradle

  mac下配置gradle的环境变量 http://blog.csdn.net/tammy_min/article/details/21597083   實際路徑 /Users/kirk/Documents/java/gradle/gradle-2.7/bin   Gradle命令行黑魔法 http://www.cnblogs.com/huang0925/p/3295862.html   Android Studio系列教程五--Gradle命令详解与导入第三方包 http://stormzhang.com/devtools/2015/01/05/android-studio-tutorial5/     Chapter 64. The Gradle Wrapper https://docs.gradle.org/current/userguide/gradle_wrapper.html   【認識 Gradle】(3)Gradle 起手式 http://www.codedata.com.tw/java/understanding-gradle-3-getting-started/ 【認識 Gradle】(5)Gradle Task 觀念導讀 http://www.codedata.com.tw/java/understanding-gradle-3-gradle-task-abc/   How can I tell Gradle to use my testng.xml file for Test Classes and Ordering? http://stackoverflow.com/questions/4762945/how-can-i-tell-gradle-to-use-my-testng-xml-file-for-test-classes-and-ordering test { useTestNG() { // runlist to executed. path is relative to current folder suites 'src/test/resources/runlist/my_test.xml' } }   錯誤: 找不到或無法載入主要類別 org.gr

Swift 2.0 - WTF

How to call SecItemCopyMatching in Xcode 7 beta 4? http://stackoverflow.com/questions/31549059/how-to-call-secitemcopymatching-in-xcode-7-beta-4   编译ImageIO库type 'CFString!' does not conform to protocol 'NSCopying' http://blog.csdn.net/wenzfcsdn/article/details/43759849   NSCopying协议和copy方法 http://www.cnblogs.com/gogoagg/archive/2011/12/20/2294818.html http://www.cokco.cn/thread-53738-1-1.html http://blog.csdn.net/hello_hwc/article/details/47682143   How to call SecItemCopyMatching in Xcode 7 beta 4? http://stackoverflow.com/questions/31549059/how-to-call-secitemcopymatching-in-xcode-7-beta-4 let statusCode: OSStatus = SecItemCopyMatching(keychainItemQuery, &secureItemValue) let status: OSStatus = withUnsafeMutablePointer(&dataTypeRef) { SecItemCopyMatching(keychainQuery as CFDictionaryRef, UnsafeMutablePointer($0)) }   Swift1.2 -> Swift2 http://fiahfy.blogspot.tw/2015/09/swift12-swift2.html   Strings in Swift 2 https://developer.apple.com

Appium for iOS

  如何使用Command來build *.app Building and deploying iOS app for Appium tests (CI) https://discuss.appium.io/t/building-and-deploying-ios-app-for-appium-tests-ci/3732   Appium腳本 - for Node.js Start Automating Native iOS testing with Appium using Node.js https://www.built.io/blog/2015/03/start-automating-native-ios-testing-with-appium-using-node-js/ sample-code https://github.com/appium/sample-code   移除Appium npm uninstall appium -g   移除node.js https://gist.github.com/ddo/668630454ea0d74fdc21 curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh chmod +x ./uninstall-node.sh ./uninstall-node.sh rm uninstall-node.sh   重新安裝node.js (這樣安裝才不需要root) brew install node   has some problum : brew link node sudo chown -R `whoami` /usr/local/

格式化Blogger文章

FORMAT MY SOURCE CODE FOR BLOGGING http://formatmysourcecode.blogspot.tw/ 測試內容   幫 Blogger 文章鎖上密碼 方案1(重編輯後會不能用…) http://apps.kerthis.com/encrypt-post/ 方案2(推) http://freeingcockatiel.blogspot.tw/2014/02/google-blog.html http://xox520.blogspot.com/2011/04/hide-post-in-blogger.html 加密位置 http://www.vincentcheung.ca/jsencryption/ http://xox520.blogspot.com/p/encoder.html?m=1 Demo 測試用密碼:test 顯示加密內容   SyntaxHighlighter http://pydoing.blogspot.tw/2010/11/syntaxhighlighter-blogger.html http://blog.xuite.net/andy19890411/Orz/37326267 http://alexgorbatchev.com/SyntaxHighlighter/download/ https://github.com/syntaxhighlighter Demo func getCurrentDateTimeString()->String{ let date = NSDate() let calendar = NSCalendar.currentCalendar() let components = calendar.components([.Year, .Month, .Day, .Hour, .Minute, .Second, .Weekday, .WeekdayOrdinal] , fromDate: date) let year = components.year let month = String(format: "%02d", components.month)

Sublime

Sublime 安裝 Package Control 1. 按下 command + ~ 2. 貼上 import command https://packagecontrol.io/installation#st2   JsFormat ( 排版 ) cmd + alt + f   JSHint ctrl + j   Pretty JSON ctrl + alt + j   Alignment ctrl + alt + a   Trimmer ctrl + alt + s   Find Function Definition F8   keymapManager ctrl + alt + k   Appium https://github.com/webdriverio/sublime-bundle

好用的尋找Path工具 - Firepath

特地要寫下來是因為我這次又需要找XPath時,完全把它給忘了…真的是老了啦     Firepath https://addons.mozilla.org/en-US/firefox/addon/firepath/  

SmartHome APP 使用教學

  當完成Gateway的授權後,可進入Gateway列表頁面                                       點擊綠色房子即可進入該Gateway內                                       顯示Gateway上所有的Device,Device分成兩類 一類為可控制類,如下                                       點擊後會跳出視窗顯示Device資訊控制元件                                       單點控制 UI Demo   單點控制 Demo   另一類為不可控制類                                       點擊後顯示該Device的狀態                                       點擊左下方Tab即可進入群組模式,點擊Plus圖示即可新增新群組                                       設定圖案、名稱及Device的動作                                       進行Device動作設定                                       完成群組設定                                       啟用群組模式                                       完成啟用                                         進入條件模式