DisplayMap.h
#import
#import
@interface DisplayMap : NSObject {
CLL
Your subtitle
property is declared with a copy
attribute, which means you are responsible for releasing it. The following change to your dealloc
method should do the trick:
-(void)dealloc{
[subtitle release];
[title release];
[super dealloc];
}
Edit: To elaborate: Cocoa's memory management rules state that you must release
any memory that you alloc
, retain
or copy
. In the case of synthesized properties, this means that you must include the appropriate release
messages in your -dealloc
method. See my own question on this topic for more details.
In the sample code that you provided, the following line:
ann.subtitle = [[xmlParameter objectAtIndex:i]objectAtIndex:1];
Creates a copy of the indicated object. When you later call [ann release]
, that copied object will be leaked unless you explicitly release it.