Memory management for "id<ProtocolName> variableName" type properties

Posted by Malakim on Stack Overflow See other posts from Stack Overflow or by Malakim
Published on 2010-05-19T08:08:12Z Indexed on 2010/05/19 8:10 UTC
Read the original article Hit count: 188

Hi,

I'm having a problem with properties of the following type:

id<ProtocolName> variableName;
.....
.....
@property (nonatomic, retain) id<ProtocolName> variableName;

I can access and use them just fine, but when I try to call

[variableName release];

I get compiler warnings:

'-release' not found in protocol(s)

Do I need to define a release method in the interface, or how do I release the memory reserved for the variable?

Thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c