• 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: Releasing by reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing by reference


  • Subject: Re: Releasing by reference
  • From: email@hidden
  • Date: Wed, 1 Aug 2007 15:16:17 +0200

The implementation is something like this:

Object in class A: [QTMovie movieWithFile:@"/path/to/mov" error:err]

Sent as parameter aMovie to class B:

static QTMovie *mov = nil;

- (QTMovieView *)openMovie: (QTMovie *) aMovie {
mov = aMovie;
}

- dealloc {
if ( mov != nil ) {
[mov release];
mov = nil;
 }
}


On 8/1/07, Stephane Sudre <email@hidden> wrote:
>
>
> On 1 août 07, at 14:02, email@hidden wrote:
>
> > Hello!
> > I'm initializing an object in class A, passing it to class B where it
> > is
> > held in a static variable. I then release the object by referencing the
> > variable. Does this also release the original object, or do I have to
> > release it in class A?
>
> The answer is probably no but it's difficult to be 100% affirmative
> without additional information on your implementation.
>
> _______________________________________________
>
> 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:
> email@hidden
>
> This email sent to email@hidden
>
_______________________________________________

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

  • Follow-Ups:
    • Re: Releasing by reference
      • From: Scott Morrison <email@hidden>
    • Re: Releasing by reference
      • From: j o a r <email@hidden>
    • Re: Releasing by reference
      • From: apparao <email@hidden>
References: 
 >Releasing by reference (From: email@hidden)
 >Re: Releasing by reference (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Re: Moveable/Resizable "Box" views and blurry frame
  • Next by Date: Re: Setting "Allows multiple fonts" to NO programmatically
  • Previous by thread: Re: Releasing by reference
  • Next by thread: Re: Releasing by reference
  • Index(es):
    • Date
    • Thread