• 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: Script Menu: Code generation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Menu: Code generation


  • Subject: Re: Script Menu: Code generation
  • From: Nathan Day <email@hidden>
  • Date: Fri, 30 Dec 2005 13:03:45 +1100

It safer it the container object of x is released it will most likely release x and the caller of -x may still be trying to use the result. This is most likely to occur in a multi thread app but can also occur after the caller of -x releases the container of x and expects to still use the result.

On 29/12/2005, at 9:17 AM, Alexander von Below wrote:

Dear List,

the very useful Scripts menu of Xcode contains an item to create accessor definitions.

While it is most certainly correct, I am wondering why it produces:

- (id) x {
	return [[x retain] autorelease];
}

Is this not redundant? Why not just return x?

I guess that the setter code is a matter of preference. The original code copies the new value, I have edited it to retain the value.


Your comments and thoughts on this would be very interesting.

Thanks

Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Script Menu: Code generation (From: Alexander von Below <email@hidden>)

  • Prev by Date: Re: Xcode customizations, workflows, specifications
  • Next by Date: Re: __FILE__ Without Full Path?
  • Previous by thread: Re: Script Menu: Code generation
  • Next by thread: Xcode/Mac OS X version mismatch
  • Index(es):
    • Date
    • Thread