objective c - return dictionary leak cause crash -


i have confusion me property object this

nsmutabledictionary* spradsettingvaluebylinkcode; @property (nonatomic, retain) nsmutabledictionary * spradsettingvaluebylinkcode; 

and synthesize in .m file like

@synthesize spradsettingvaluebylinkcode =   _spradsettingvaluebylinkcode; 

then using property setting value return function that

_spradsettingvaluebylinkcode = (nsmutabledictionary*)[_dbobject initwithspradersetting:inputlinkcode]; 

well issue

1) assign property not retain when use dictionary table view

2) if allocate

_spradsettingvaluebylinkcode = [[nsmutabledictionary alloc] initwithdictionary:[_dbobject initwithspradersetting:inputlinkcode]]; 

then can't release because app crash , if not release memory leak

so below code if working me perfect not looking right me need ask doing right or wrong?

// method use load view of spreadersettings - (void) loadspreadersettingsvalues:(nsstring*)inputlinkcode {      [_spradsettingvaluebylinkcode removeallobjects];      if (!_dbobject) [self loaddbaccessdatabase];      [_spradsettingvaluebylinkcode release]; // relase previos retain object maintain count 1     _spradsettingvaluebylinkcode = (nsmutabledictionary*)[_dbobject initwithspradersetting:inputlinkcode];     [_spradsettingvaluebylinkcode retain];     [_productanalysistitlelabel settitle:[_spradsettingvaluebylinkcode objectforkey:@"description"]];     [_tbspreadersetting reloaddata]; }  - (dbaccess *) loaddbaccessdatabase {     // nslog(@"%s", __function__);      _dbobject = [dbaccess shareddbobjectaccess];     return _dbobject; } 


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -