• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Object-C question #1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object-C question #1


  • Subject: Re: Object-C question #1
  • From: Thomas Davie <email@hidden>
  • Date: Wed, 8 Dec 2004 04:16:52 +0000

On 8 Dec 2004, at 04:10, King Chung Huang wrote:

You probably intended to send the parseString: message to yourself. If so, the initWithString: method should probably look something like this:

- (id)initWithString:(NSString *)string {
	if (self = [super init]) {
		[self parseString:string];
	}

	return self;
}

Actually, your init method should look exactly like this. I've seen quite a few variants on the init method... But this style is the only one that captures the correct semantics that cocoa asks for.


Bob

--
What is the internet?
It's the largest equivalence class in the reflexive transitive symmetric closure of the relationship "can be reached by an IP packet from". -- Seth Breidbart



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Object-C question #1
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >Object-C question #1 (From: Mark Dawson <email@hidden>)
 >Re: Object-C question #1 (From: King Chung Huang <email@hidden>)

  • Prev by Date: Re: [newbie] Cyclic #import
  • Next by Date: Re: [newbie] Cyclic #import
  • Previous by thread: Re: Object-C question #1
  • Next by thread: Re: Object-C question #1
  • Index(es):
    • Date
    • Thread