+ Start a Discussion
Jim BoudreauxJim Boudreaux 

Mobile SDK, XCode 4.5 and Storyboards

I have been through all the docs and googled everything I can find and I still can't find an answer. 

 

When you create a new project in XCode 4.5 using the  Native Force.com REST App template, there is no option to use Storyboards, XCode 4.5's version of XIB files. Having created a new project without them, I added a storyboard file manually and set it up in the project's Summary tab as the Main Storyboard, and yet it gets ignored. I am not sure what I am supposed to do as there is no documentation on using storyboards anywhere.

 

Any insight?

Gaurav KheterpalGaurav Kheterpal

IMO, this will be a bit tricky with the latest force.com iOS SDK. The Storyboard documentation says

 

Last but perhaps most important, remove the code that set up the view controllers from the application:didFinishLaunchingWithOptions: method in your app delegate’s implementation. With storyboards, you will no longer need to set up view controllers manually in your app delegate, so have a look at the aforementioned method and remove the unnecessary setup. This is important step for using storyboard for existing project

The native Salesforce template has an appDelegate which is a subclass of SFNativeRestAppDelegate. This class in turn has the method application:didFinishLaunchingWithOptions delegate method which should be overriden. This is present in the SFNativeRestAppDelegate.m file.

 

However, in the latest version of iOS Mobile SDK, it appears that the SFNativeRestAppDelegate.m file has moved to a libSalesforceSDK.a library.

 

http://boards.developerforce.com/t5/Mobile/iOS-SFNativeRestAppDelegate-is-no-longer-available/td-p/466581

 

You should try subclassing SFNativeRestAppDelegate and overriding this method. That should work.

 

I hope this helps.

 

Regards,
Gaurav