Big Red Button

Discussion in 'iOS Development' started by Chicken, Sep 26, 2008.

  1. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Just wondering how I can get a big red button in the middle of my app???

    Help would be really appreciated
    ------------------double post merged------------------
    sorry for double posting but when I try to compile what I've got i get this error

    main.m:5: error: expected ':', ',', ';', '}' or '__attribute__' before '{' token
    make: *** [main.o] Error 1

    I cant see anything wrong with my main.m file i've reinstalled the toolchain and still this error comes up

    here is my main.m file

    Code:
    #import <UIKit/UIKit.h>
    #import "my app (not really the name).h"
    
    int main(int argc, char *argv[])
    {
    	NSAutoreleasePool* pool = [ [ NSAutoreleasePool alloc ] init ];
    	int AppReturn;
    	AppReturn = UIApplicationMain( argc, argv, @"My app", @"My app" );
    	return AppReturn;
    	[ pool release ];
    }
    
    all help is appreciated
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129

    It won't fix your problem, but you should find some better sources to learn from. A function ends when it is told to return a value. Putting [pool release] after return AppReturn will do you no good. It seems everyone is learning from the same person, and they are all making the same mistakes as the same person because the person either has no idea what they are doing, or are a major copy/paste fiend and never noticed the mistake, only changing their app and delegate class with each app.

    It's been bothering me a lot, lately.

    Please, take this chance to find a enw teacher, and do things right.
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    i've been guilty of that in the past. i've been hitting some crazy stuff though, thats why i've released no apps recently. i've been looking more into code tutorials and such, not so much objective-c, but C and the new features in objective-c 2.0.

    what i didn't know before was that everything stops after the return in a function. but i guess now i feel dumb as it seems pretty obvious to me. i've also been playing around with mobilesubstrate, hooking springboard. its..kinda...addicting

    Please Register or Log in to view images

  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    right thanks for the help I'll fiddle with it for a bit see if I can get it to work

    any news on how to make my big red button???????
    -------------------------------------------------------------------------------------
    edit

    still cant figure it out help please I want it to work

Share This Page