Translate

顯示具有 iPad 標籤的文章。 顯示所有文章
顯示具有 iPad 標籤的文章。 顯示所有文章

2015年12月20日 星期日

Watchkit app fails to launch only on ipad

Watchkit app fails to launch only on ipad
What happens is that turning on the HealthKit capability on the Apple Watch extension adds a value healthkitto the UIRequiredDeviceCapabilities array of that same target.

For some strange reason that value prevents the app from launching properly on any iPad device. Manually removing the healthkit value from the Apple Watch extension target plist fixed the issue and submission was successful.

2013年7月1日 星期一

iPad willAnimateRotationToInterfaceOrientation

這幾天再寫個ipad專案
發現有時候willAnimateRotationToInterfaceOrientation沒有被呼叫到
所以上網查了一下資料
參考link
This is expected behavior as I see it. If the UIVC is not on the top of the stack, then willAnimateRotationToInterfaceOrientation shouldn't be called as no rotation is being animated at that time. The way I've been handling this in the app I am working on now is similar to the above poster. Any UIVC that supports all orientations gets a new method

- (void) updateLayoutForNewOrientation: (UIInterfaceOrientation) orientation;

This method is called from two places:

-(void) viewWillAppear: (BOOL) animated { [super viewWillAppear: animated]; [self updateLayoutForNewOrientation: self.interfaceOrientation]; }
-(void) willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation duration: (NSTimeInterval) duration { [self updateLayoutForNewOrientation: interfaceOrientation]; }
The new method is simple:

- (void) updateLayoutForNewOrientation: (UIInterfaceOrientation) orientation { if (UIInterfaceOrientationIsLandscape(orientation)) { // Do some stuff } else { // Do some other stuff } }

2013年4月29日 星期一

Master Detail Application for iPad UISplitViewController, MultipleDetailViews with Navigation Controller

重要的link 最近在研究
Master Detail Application for iPad
發現ㄚ
有人也想跟我一樣替換掉Detail的ViewController
發現stackoverflow有人回答了
參考link

The split view controller has a property, viewControllers.
The object at index 1 is the detail controller.
You should just create a mutable copy of viewControllers,
replace the object at index 1 with your new controller,
and set that array to be the split view's arrayControllers.

NextController *next = [[NextController alloc] init..... // or however you get your new controller NSMutableArray *mut = [self.splitViewController.viewControllers mutableCopy]; [mut replaceObjectAtIndex:1 withObject:next]; self.splitViewController.viewControllers = mut; 另外參考link