Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: beginner obj-c question



On Fri, Apr 4, 2008 at 11:32 AM, Baiss Eric Magnusson <email@hidden> wrote:
In trying to learn obj-c I decided to factor the button code from HelloWorldClassic, the factored code compiles ok but the call is flagged.

Could someone tell me how the call should be?

- (UIButton *)makeButton: (NSString *)bkgrdImage: (NSString *)btnName  {    
    ...
return button;
}

UIButton *button = self makeButton[ (NSString *)@"Button.png": (NSString *)@"Login" ];
****************************************
warning: initialization from distinct Objective-C type
error: syntax error before 'makeButton'

Whatever language you're writing, it's not Objective-C. I think you need to restart the beginners tutorial.

- (UIButton*) makeButton:(NSString*)btnName bkgrdImage:(NSString*)btnBackground  {    
    ...
return button;
}

UIButton *button = [self makeButton:@"Login" bkgrdImage:@"Button.png"];

Being generous, this fixes at least a half dozen basic syntax errors.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/objc-language/email@hidden

This email sent to email@hidden

References: 
 >beginner obj-c question (From: Baiss Eric Magnusson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.