undeclared

Discussion in 'iOS Programming' started by kpiller08, Mar 16, 2010.

  1. kpiller08 macrumors newbie

    Joined:
    Mar 16, 2010
    #1
    I am so new to this iphone development and am following along in a cocoa programming book. I followed the instructions to a tree and when i build and run i get lots of undeclared errors. I don't know how to fix.
    Code:
    #import "AccountController.h"
    
    @implementation AccountController
    
    - (void)awakeFromNib {
    	[COLOR="RoyalBlue"]account = [[Account alloc] init];[/COLOR]
    	[display setFloatValue:[account balance]];
    }
    
    
    - (IBAction)deposit:(id)sender {
    	[COLOR="RoyalBlue"][account deposit:20.00f];[/COLOR]
    	[display setFloatValue:[account balance]];
    }
    
    - (IBAction)withdraw:(id)sender {
    	[COLOR="RoyalBlue"][account withdraw:5.00f];[/COLOR]
    	[display setFloatValue:[account	balance]];
    }
    
    - (void)dealloc {
    	[COLOR="RoyalBlue"][account release];[/COLOR]
    	[super dealloc];
    }
    
    @end
    everything in blue is undeclared. do i need to got into the account.h file to fix?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    So new that you didn't post this in the correct place. I have requested that the mods move it to the iPhone Programming forum.

    Please post the .h file that goes with this .m file. Normally you'd delcare you instance variables in there. I suspect you haven't declared account in there.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Also, please be specific when referring to books. What is the book's title? Author? Edition? If you provide these details, it makes it easier for us to help you.
     

Share This Page