• 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: Method not seeing array as array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Method not seeing array as array


  • Subject: Re: Method not seeing array as array
  • From: Andrew Farmer <email@hidden>
  • Date: Wed, 2 Feb 2005 20:13:33 -0800

On 2 Feb 2005, at 17:43, Shawn Erickson wrote:
<snip>

...or the following for more complex cases (assumes dealloc will clean stuff as needed)...


-(id)init
{
	bool failed = NO;

	if ((self = [super init]) == nil) {
		return nil;
	}

for(;;) {

I assume you meant
do { ... } while(0);

in which case a better pattern using block structures might be

- (id)init
{
	if((self = [super init]) == nil)
		return nil;
	do {
		if(!<stuffWorks>)
			break;

		if(!<moreStuffWorks>)
			break;

		return self;
	} while(0);

	[self release];
	return nil;
}

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
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: Method not seeing array as array
      • From: Shawn Erickson <email@hidden>
References: 
 >Method not seeing array as array (From: Michael Swan <email@hidden>)
 >Re: Method not seeing array as array (From: Andrew Farmer <email@hidden>)
 >Re: Method not seeing array as array (From: Marco Scheurer <email@hidden>)
 >Re: Method not seeing array as array (From: Andrew Farmer <email@hidden>)
 >Re: Method not seeing array as array (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: Installer for a plug-in
  • Next by Date: Re: difference between frameworks and plugins
  • Previous by thread: Re: Method not seeing array as array
  • Next by thread: Re: Method not seeing array as array
  • Index(es):
    • Date
    • Thread