FROM : David Remahl
DATE : Thu Oct 31 16:34:35 2002
Nope, you didn't miss anything. But both methods work. Check the archives
from several months ago for a discussion on this issue.
/ Regards, David
> Document-based\ Application/MyDocument.m
> puzzles me. The initializer is
>
> - (id)init
> {
> [super init];
> if (self) {
>
> // Add your subclass-specific initialization here.
> // If an error occurs here, send a [self dealloc] message and
> return nil.
>
> }
> return self;
> }
>
> I am wondering how self has been given a chance to change its value.
> Unless self is passed by address to the inherited init method (as an
> hidden parameter), self won't change and the above test on self is
> useless. A better pattern seems to be
>
> - (id)init
> {
> if (self = [super init]) {
>
> // Add your subclass-specific initialization here.
> // If an error occurs here, send a [self dealloc] message and
> return nil.
>
> }
> return self;
> }
> Did I miss something?
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Thu Oct 31 16:34:35 2002
Nope, you didn't miss anything. But both methods work. Check the archives
from several months ago for a discussion on this issue.
/ Regards, David
> Document-based\ Application/MyDocument.m
> puzzles me. The initializer is
>
> - (id)init
> {
> [super init];
> if (self) {
>
> // Add your subclass-specific initialization here.
> // If an error occurs here, send a [self dealloc] message and
> return nil.
>
> }
> return self;
> }
>
> I am wondering how self has been given a chance to change its value.
> Unless self is passed by address to the inherited init method (as an
> hidden parameter), self won't change and the above test on self is
> useless. A better pattern seems to be
>
> - (id)init
> {
> if (self = [super init]) {
>
> // Add your subclass-specific initialization here.
> // If an error occurs here, send a [self dealloc] message and
> return nil.
>
> }
> return self;
> }
> Did I miss something?
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Jérôme Laurens | Oct 31, 16:24 | |
| David Remahl | Oct 31, 16:34 | |
| Jérôme Laurens | Nov 4, 12:08 |






Cocoa mail archive

