Please Help! Almost Finished App and a few errors i cant identify!

Discussion in 'iOS Programming' started by pcs are junk, Jan 16, 2010.

  1. pcs are junk macrumors 65816

    Joined:
    Sep 28, 2009
    #1
    Hi guys, this is my first real app that im developing for the iphone. i have everything all connected, except for these few errors. i would love to finish this app, to impress my father, because he would be very proud of me. so can somebody please help me out with this im not sure how to fix this. thanks in advance! Screen shot 2010-01-17 at 2.45.12 AM.png

    here is the code after the signing stuff with my name and junk.


    #import "UIWindow.h"

    @implementation MainView

    - (void)awakeFromNib {
    [self addSubview:iPhoneTips];
    }

    - (IBAction)iPhone {Applications {
    [iPhone Tips removeFromSuperview];
    [self addSubview:iPhone Applications];
    }

    - (IBAction)Hacking {the iPhone {
    [iPhone Applications removeFromSuperview];
    [self addSubview:Hacking the iPhone];
    }

    - (IBAction)Secrets {of the iPhone {
    [Hacking the iPhone removeFromSuperview];
    [self addSubview:Secrets of the iPhone];
    }

    -(IBAction)Keeping {your iPhone Safe {
    [Secrets of the iPhone removeFromSuperview];
    [self addSubview:Keeping your iPhone Safe];
    }

    - (IBAction)Battery ;{Life {
    [Keeping your iPhone Safe removeFromSuperview];
    [self addSubview:Battery Life];
    }

    - (IBAction)Main {
    [Battery Life removeFromSuperview];
    [self addSubview:iPhone Tips];
    }

    @end
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You appear to be trying to have spaces and all sort of stuff in your variable names. Which you can't.
     
  3. SnowLeopard2008 macrumors 604

    SnowLeopard2008

    Joined:
    Jul 4, 2008
    Location:
    Silicon Valley
  4. pcs are junk thread starter macrumors 65816

    Joined:
    Sep 28, 2009
    #4
    everything i do doesnt change anything, i still have the same amount of errors as before. its telling me "Expected ";" before "{" token" then its also saying "Applications undeclared". what does this mean? i have tried all the possible ways of putting ; before { and none of them work. can someone please correct my errors and post the correct code? thanks!
     
  5. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Look, what you posted isn't even close to valid Objective-C. I think you need to step back, read something on the language and actually learn what you are doing.

    If Interface Builder created the file for you originally it's done it this way as you gave it invalid names for your actions. Once again because, I would suggest, you don't really know what you're doing and have not bothered to learn properly.
     
  6. pcs are junk thread starter macrumors 65816

    Joined:
    Sep 28, 2009
    #6
    so...this means that since u cant fix it, then you dont know what you're doing and havnt bothered to learn properly. thanks for insulting yourself. :rolleyes:
     
  7. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #7
    Wow, way to try and get help. I could easily turn that into valid Objective-C. If I did so you'd learn nothing and then come complaining to me that it didn't work as to fix it I'd rename the IBAction methods and that would break their connections in Interface Builder.

    Due to your attitude I'm not going to make an further effort to point you in the correct direction. I hope you are more polite to people in real life.
     
  8. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #8
    Also, we do not like to just post fixed code as it does not aid you in learning anything. You problems are numerous. No variables should have spaces in them, you have curly braces and semi's in places they dont belong. As to the other person's suggestion to read up on the programming language and syntax. I second that.
     
  9. pcs are junk thread starter macrumors 65816

    Joined:
    Sep 28, 2009
  10. KnightWRX macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #10
    Let's just take 1 block to see the problems :

    - (IBAction)iPhone {Applications {
    [iPhone Tips removeFromSuperview];
    [self addSubview:iPhone Applications];
    }

    There's 2 { in there for one }. You have inconsistent blocks. Start by properly opening/closing all your code blocks so that it is at least legible. That's what your unexpected token messages are about. Next is removing spaces in variable names. This block should look like this :

    - (IBAction) iPhoneApplications {
    [iPhoneTips removeFromSuperview];
    [self addSubview:iPhoneApplications];
    }
     
  11. pcs are junk thread starter macrumors 65816

    Joined:
    Sep 28, 2009
    #11

Share This Page