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




From: Dave MacLachlan <email@hidden>

On Apr 04, 2008, at 09:32 , Baiss Eric Magnusson 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" ];


I think you want:

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

That helped, the actual call I wanted, I think, is:
UIButton *button = [self makeButton: @"Button.png" : @"Login" ];

Which compiled fine, you had < bkgrdImage> in the line and that caused a warning, I don't grok named parameters yet.

----

Baiss Eric Magnusson

Cascade Web Design

<http://www.CascadeWebDesign.com>



 _______________________________________________
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



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.