• 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: Factory AutoRelease
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Factory AutoRelease


  • Subject: Re: Factory AutoRelease
  • From: sinclair44 <email@hidden>
  • Date: Sun, 04 May 2003 17:56:02 -0400

On 5/4/03 5:45 PM, "Bryan Rieger" <email@hidden> wrote:

> How can you tell if an object created by a class factory method calls
> autorelease on an object before it returns it to the caller. ie
>
> myScanner = [NSScanner scannerWithString: aString];
>
> is myScanner already in the autorelease pool?

Yes. The general rule is that if you didn't +alloc or -copy it, you don't
need to release it. (It *ISN'T* necessarily autoreleased!)
--

-- sinclair44

[self becomeWorldDictator];

- (void)becomeWorldDictator
{
[self coverLegalButt];

[[GeorgeBush principalClass] assassinate:[world currentLeaders]];
[[BinLaden principalClass] terrorize:[world citizens]];
[world setCurrentLeaders:[NSArray arrayWithObject:self]];
}

- (void)coverLegalButt
{
/* The above does not reflect any plans, expressed or implied, real or
imaginative, to kill or assassinate anyone, or to harm anyone in any shape,
way or form. Any relation to actual events is purely coincidental. */
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Factory AutoRelease (From: Bryan Rieger <email@hidden>)

  • Prev by Date: Re: Cocoa - Naive questions about memory
  • Next by Date: Re: Factory AutoRelease
  • Previous by thread: Factory AutoRelease
  • Next by thread: Re: Factory AutoRelease
  • Index(es):
    • Date
    • Thread