iphone - IS this class Many part of memory Leak -
i confuse class.
specially memory management.
please guide me nsstring concept @ here.
my class is.
#import <foundation/foundation.h> @interface itinerary_detail : nsobject { nsstring *itinerary_title; nsstring *itinerary_creator; nsstring *itinerary_identifiere; nsstring *itinerary_created; nsstring *itinerary_modified; } @property (retain) nsstring *itinerary_title; @property (retain) nsstring *itinerary_creator; @property (retain) nsstring *itinerary_identifiere; @property (retain) nsstring *itinerary_created; @property (retain) nsstring *itinerary_modified; -(void) itinerary_initialization; -(void) itinerary_title:(nsstring *) xml_value; -(void) itinerary_creator:(nsstring *) xml_value; -(void) itinerary_identifiere:(nsstring *) xml_value; -(void) itinerary_created:(nsstring *) xml_value; -(void) itinerary_modified:(nsstring *) xml_value; @end
and .m class is
#import "itinerary_detail.h" @implementation itinerary_detail @synthesize itinerary_title,itinerary_creator,itinerary_identifiere,itinerary_created,itinerary_modified; -(void) itinerary_initialization { itinerary_title=@"null"; itinerary_creator=@"null"; itinerary_identifiere=@"null"; itinerary_created=@"null"; itinerary_modified=@"null"; } -(void) itinerary_title:(nsstring *) xml_value { itinerary_title=xml_value; } -(void) itinerary_creator:(nsstring *) xml_value { itinerary_creator=xml_value; } -(void) itinerary_identifiere:(nsstring *) xml_value { itinerary_identifiere=xml_value; } -(void) itinerary_created:(nsstring *) xml_value { itinerary_created=xml_value; } -(void) itinerary_modified:(nsstring *) xml_value { itinerary_modified=xml_value; } -(void) dealloc { [itinerary_title release]; [itinerary_creator release]; [itinerary_identifiere release]; [itinerary_created release]; [itinerary_modified release]; [super dealloc]; } @end
my question about.
1- type deceleration of nsstring in class of memory leak issue. if yes please how change this.
2- using class other class that
itinerary_detail *check=[[itinerary_detail alloc] init]; [check itinerary_initialization]; [check release];
my question right way . or memory leak issue.
please guide me how deceleration of class , how handle memory leak issues.
please me
the problem come fact don't use property directly access member variable. replace itinerary_title=xml_value
by self.itinerary_title=xml_value
btw, string properties (copy) , not (retain) , why create methods while synthesize you.
remove methods .h file , .m file , set property as
@property (copy) nsstring* mystring;
Comments
Post a Comment