Re: Objective-C default arguments??
Re: Objective-C default arguments??
- Subject: Re: Objective-C default arguments??
- From: Sherm Pendley <email@hidden>
- Date: Sat, 1 Nov 2003 02:28:58 -0500
On Nov 1, 2003, at 2:18 AM, Malcolm Sharman wrote:
Instead of -(void)initWithFile:(NSString *)path=@""
setmovie:(BOOL)setMovie=NO;
I use
-(void)initWithFile:(NSString *)path setMovie:(BOOL)setMovie
And
-(void)initWithFile:(NSString *)path
{
[self initWithFile:path setMovie:NO];
}
It is kind of a hack, but it works.
It's not really a hack; it's the recommended way of doing it. Take a
look at the following page, in the section "Designated Initializer."
<
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/
4objc_runtime_overview/chapter_4_section_2.html>
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.