• 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
Core Foundation Objects and Properties when using ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Foundation Objects and Properties when using ARC


  • Subject: Core Foundation Objects and Properties when using ARC
  • From: Dave <email@hidden>
  • Date: Fri, 11 Jan 2013 00:35:57 +0000

Hi,

I've looked all over and just can't seem to find the recommended approach to handling CF objects in properties when using ARC.

I have an init method that needs to create a CF object and store it as a property for use while the object is alive. When the object is released I want to release the CF Object,

Code:

-(id) init
{
// normal init code


CFThingRef myCFThing = CFThingCreate();

self.propCFThing = myCFThing;
}


-(void) dealloc
{
CFRelease(self.propCFThing);
self.propCFThing = NULL;
}

This code gives analyzer warnings saying that a CF object has leaked.

What is the best way to stop the warnings?

Thanks in Advance
Dave

_______________________________________________

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: Core Foundation Objects and Properties when using ARC
      • From: John McCall <email@hidden>
References: 
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Martin Hewitson <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Mike Abdullah <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Martin Hewitson <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Mike Abdullah <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Martin Hewitson <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Martin Hewitson <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Peter <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Martin Hewitson <email@hidden>)
 >Re: Cococa-Dev : was [coredata count not fulfill fault after object delete] (From: Peter <email@hidden>)

  • Prev by Date: Re: NSTabviewItem View
  • Next by Date: Re: NSTabviewItem View
  • Previous by thread: Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
  • Next by thread: Re: Core Foundation Objects and Properties when using ARC
  • Index(es):
    • Date
    • Thread