2014年1月8日 星期三

將舊iPhone 專案 xib 加入 StoryBoard

Recently, I'm trying to update my app. To make it support iPhone. iTunes: 剪髮管理


When I try to add a storyboard to my current project like this:


But!!!  things never gone so well. 事情絕對不是我們所想這麼簡單的!

So I'm try to compare the default project for the latest Xcode 5.0. 

發現,這兩點已經悄悄的改變了。

ApplicationDelegate:
Before

After
 main.m:
Before
 After

特別的是第一點,從Xcode 4.x, 當StoryBoard被導入進來後,Default 的 ApplicationDelegate Class 從繼承 NSObject 改成 UIResponder。

Reference on Apple:

Note: In the current Xcode templates, the application delegate class inherits from UIResponder. This is so that the delegate instance can participate in the responder chain and so handle application-level actions. If you haven’t made use of this pattern in an existing application, there’s no need to adopt it for storyboards.
意思是說,若你以前的專案沒在用StoryBoard,你就繼續用Xib吧。 

目前是改到這樣,只是對於 iPad (走Xib)的會不會有什麼影響還不確定。





沒有留言:

張貼留言