發表文章

目前顯示的是 2015的文章

OS X EI Capitan 10.11.1更新後,Xcode Git Remote 連不上?

我們在開發iOS App有用到Git來做版控,同時也是方便Team work,用了最簡單的方式來架設Git的遠端環境。就是找一台Mac來當remote主機,每台開發Mac使用SSH的方式連入。 設定簡單,而且remote就在自家,也不用擔心放到雲端會有資料外洩的風險。 沒想到今天在那台Mac上不小心把OS X更新到10.11.1之後,所有的開發機就不能再用Git push pull的功能了。只好開始找問題了: 1. 由開發Mac來SSH remote, 其實是正常的,而且xxx.git目錄也都存在 2. 但由開發Mac的Xcode, Source Control -> Push卻出現連不上remote的錯誤訊息 想想,就ssh到remote,cd 到xxx.git 然後 $ git Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. $ sudo git Password: You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode. Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf' Apple Inc. Xcode and Apple SDKs Agreement PLEASE SCROLL DOWN AND READ ALL OF THE FOLLOWING TERMS AND CONDITIONS CAREFULLY BEFORE USING THE APPLE SOFTWARE OR APPLE SERVICES.  THIS IS A LEGAL AGREEMENT BETWEEN YOU AND APPLE.  IF YOU AGR...

iOS 進入Background後可執行時間,可額外要求的時間由10分鐘變成3分鐘?

在不同的文件中看到iOS App由前景進入背景後,只能再執行10秒或者5秒。然後就會被suspended! 之前iOS 7的書籍中提到可以再額外要求10分鐘,當然現在iOS已經到8的版本了,今天試了一下,發現 好像可額外要求的時間又被Apple給縮短了! 建一個簡單的single view App, 其ViewController.m內容: #import "ViewController.h" @interface ViewController () { NSDateFormatter *format; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; format = [[NSDateFormatter alloc] init]; [format setDateFormat:@"H:m:s"]; [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(ticker:) userInfo:nil repeats:YES]; } - (void)ticker:(NSTimer *)theTimer { NSDate *today = [NSDate date]; NSLog(@"%@", [format stringFromDate:today]); NSLog(@"%f", [UIApplication sharedApplication].backgroundTimeRemaining); } @end 在AppDelegate.m中加入以下程式: - (void)endBackgroundTask { [[UIApplication sharedApplication] endBackgroundTask:bgTask]; } - (void)applicationDidEnterBackground:(UIApplication *)application { bgTask = [application begi...