• 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: [Obj-C] if (self) vs. if (self != nil)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Obj-C] if (self) vs. if (self != nil)


  • Subject: Re: [Obj-C] if (self) vs. if (self != nil)
  • From: Citizen <email@hidden>
  • Date: Mon, 27 Feb 2012 09:08:23 +0000

On 27 Feb 2012, at 03:51, Preston Sumner wrote:

> On Feb 26, 2012, at 7:38 PM, Graham Cox wrote:
>
>>
>> On 27/02/2012, at 1:27 PM, Karl Goiser wrote:
>>
>>> use double parentheses
>>
>>
>> Yes, but that's not what the poster was suggesting. I pointed out why that form is bad.
>>
>> This is a solution, but so is Apple's recommended form.
>>
>> --Graham
>
> Out of curiosity, where does Apple recommend a particular form? Examples in the online documentation are inconsistent in this regard.
>
> Preston

The code snippet "Objective-C init Method" in Xcode takes this form.

i.e.

- (id)init
{
    self = [super init];
    if (self) {
        <#initializations#>
    }
    return self;
}

Dave
------
David Kennedy (http://www.zenopolis.com)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >[Obj-C] if (self) vs. if (self != nil) (From: Oleg Krupnov <email@hidden>)
 >Re: [Obj-C] if (self) vs. if (self != nil) (From: William Squires <email@hidden>)
 >Re: [Obj-C] if (self) vs. if (self != nil) (From: Graham Cox <email@hidden>)
 >Re: [Obj-C] if (self) vs. if (self != nil) (From: Karl Goiser <email@hidden>)
 >Re: [Obj-C] if (self) vs. if (self != nil) (From: Graham Cox <email@hidden>)
 >Re: [Obj-C] if (self) vs. if (self != nil) (From: Preston Sumner <email@hidden>)

  • Prev by Date: Re: [Obj-C] if (self) vs. if (self != nil)
  • Next by Date: Re: Application Suite Preferences
  • Previous by thread: Re: [Obj-C] if (self) vs. if (self != nil)
  • Next by thread: Re: [Obj-C] if (self) vs. if (self != nil)
  • Index(es):
    • Date
    • Thread