Migrating a simple application from Application Delegate to ViewController Class
Posted
by eco_bach
on Stack Overflow
See other posts from Stack Overflow
or by eco_bach
Published on 2010-06-12T22:25:12Z
Indexed on
2010/06/12
22:33 UTC
Read the original article
Hit count: 254
objective-c
|best-practices
Hi
Frst of all wanted to send out a huge thanks for the great feedback and support.
I have a simple application working, right now simply loads a sequence of images and alows the user to step thru the images by clicking a button.
All of my logic is in my Application Delegate class, with the image loading, initialization of UIImage Views etc happening in my applicationDidFinishLaunching method.
My next step is to migrate as much as possible all of the logic from this class to a ViewController, to take advantage of the extra functionality etc in viewcontrollers.
All my images and imageViews are initialized like the following in my applicationDidFinishLaunching.
img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@image1.jpg" ofType:nil]];
imgView = [[UIImageView alloc] initWithImage:img];
How would I migrate this to a ViewController based application?
Where would I put all of the logic currently in my applicationDidFinishLaunching method, or for loading of images, is it necessary to only load them here?
Any feedback, tips, suggestions appreciated.
© Stack Overflow or respective owner