Simple App

Discussion in 'iOS Development' started by gojohnnyboi, Oct 8, 2008.

  1. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    For those who wish to just see a bare-bones app, that does nothing but *not crash*, keep reading. Just a starter template for those who needed a small sample

    main.m
    Code:
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import "BlankApp.h"
    
    int main(int argc, char* argv[]) {
            NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
            int appReturn = UIApplicationMain(argc,argv,@"BlankApp",@"BlankApp");
            [pool release];
            return appReturn;
    }
    
    BlankApp.h
    Code:
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    
    #define FullScreenRect [UIScreen mainScreen].bounds
    
    @interface BlankApp : UIApplication <UIApplicationDelegate> {
            UIWindow* appWindow;
    }
    
    - (void)applicationDidFinishLaunching:(UIApplication *)theApp;
    - (void)dealloc;
    
    @property (nonatomic, retain) UIWindow* appWindow;
    
    @end
    BlankApp.m
    Code:
    #import "BlankApp.h"
    
    @implementation BlankApp
    
    @synthesize appWindow;
    
    - (void)applicationDidFinishLaunching:(UIApplication *)theApp {
            self.appWindow = [[UIWindow alloc] initWithFrame:FullScreenRect];
            [appWindow makeKeyAndVisible];
    }
    
    - (void)dealloc {
            [appWindow release];
            [super dealloc];
    }
    
    @end

    This is off the top of my head, so please, if something is wrong, post it here

    Please Register or Log in to view images

  2. iPhoneFTW

    iPhoneFTW New Member

    Joined:
    Jun 19, 2008
    Messages:
    1,214
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    Umm thanks, but whats the point?
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    not everyone knows where to start.
  4. iPhoneFTW

    iPhoneFTW New Member

    Joined:
    Jun 19, 2008
    Messages:
    1,214
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    Is this simpler than the Hello World app then?
  5. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Its simpler but dus nothing but crash
  6. eric_chaos

    eric_chaos Well-Known Member

    Joined:
    Nov 4, 2007
    Messages:
    3,746
    Likes Received:
    35
    Device:
    iPhone 4 (Black)
    It doesnt crash.
  7. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    o i read it wrong sorry im tired!
  8. eric_chaos

    eric_chaos Well-Known Member

    Joined:
    Nov 4, 2007
    Messages:
    3,746
    Likes Received:
    35
    Device:
    iPhone 4 (Black)
    Its basically hello world, without the hello world.

    Please Register or Log in to view images

  9. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    yeah thats a good way to put it

    i just noticed i got past 100 posts yay me!!!

Share This Page