I’ve been able to use viewDidLoad successfully in my view controllers, but I’d like to move some code from viewDidLoad to applicationDidFinishLaunching or application: didFinishlaunchingWithOptions. Would this have to be in the testApp file? And if so, how would either of these be called?
I don’t have the code in front of me right now, but as far as I remember it doesn’t bypass testApp, it just allows you to specify multiple testApps which get created and deleted from the main iOS application. So either you could look at modifying that example to automatically go through to starting your own testApp. The other alternative I see is to start looking into the OF lib (ofxiPhone?) code and finding the original applicationDidFinishLaunching call inside there… basically making a custom change in the lib for your own purposes.
It says in the iosNativeExample: "//NOTE: in this example testApp ( this class ) is not used. "
Instead it uses the app delegate to create a root view controller. It’s not clear to me how testApp could be plugged into such an approach. Looking briefly at ofxiPhone, it seems to use a similar approach and does not use testApp.
I did have a go at working with the original call to applicationDidFinishLaunching in ofxiPhoneAppDelegate, but I needed to use ofxiPhoneAppDelegate as a delegate of one of my view controllers in order to call a function from that view controller, and I couldn’t figure out how to do that. I’ll have a look at the other testApps you mention. Thanks.
I should mention that what I’m trying to do is to fade out a CALayer that I’ve added as a sublayer to one of my view controllers. At present I’m doing this from viewDidLoad, but a more ideal approach would be for me to call that fading out function from applicationDidFinishLaunchingWithOptions (so that the layer doesn’t reappear every time the user goes back to the app). If someone can tell me how to make that call from the ofxiPhoneAppDelegate back to my custom view controller, that would do the trick.