• 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: Undomanager and deallocate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undomanager and deallocate


  • Subject: Re: Undomanager and deallocate
  • From: "Mark's Studio" <email@hidden>
  • Date: Tue, 30 Oct 2001 10:24:00 +0100

Thanks for your replay
I will try that.

On tirsdag, oktober 30, 2001, at 10:20 , David Remahl wrote:

>> What is the correct way of doing this, if any?
>>
>> [[self undoManager] registerUndoWithTarget:self
>> selector:@selector(undoMethod:) object:[myObject copy]];
>>
>> [[self undoManager] registerUndoWithTarget:self
>> selector:@selector(undoMethod:) object:[[myObject copy] autorelease]];
>>
>> will the undoManager deallocate myObject when it's finish with it.
>> i have only tried [myObject copy] and it works without any errors, so
>> is
>> that ok?
>
> The second way is the correct one, or the object created by the copy
> call
> will be lost. What you either copy or retain, you also nead to release.
> Doing it the first way would not create an error, but the object would
> leak.
>
> / david
>
>
>
Peter Mark

Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden


References: 
 >Re: Undomanager and deallocate (From: David Remahl <email@hidden>)

  • Prev by Date: Re: Undomanager and deallocate
  • Next by Date: Re: how to change ower and setuid bit of a bundle application
  • Previous by thread: Re: Undomanager and deallocate
  • Next by thread: Capturing all the events in Full Screen Mode... Uhhh...
  • Index(es):
    • Date
    • Thread