Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well it depends on how you call your controller :</p> <ol> <li>in an instance variable of an other object : you have to release it in this object's deallocate methode</li> <li>in a function : you should release it when you do not need it anymore (retained by another object for example or it finished the job in this function), if you want to return it, just sent the message "autorelease" to it and the NSAutoReleasePool will do the job for you.</li> </ol> <p>To assign value, you can</p> <ol> <li>set the mutable array with the setParam:(*NSMutableArray)theArrayYouWantToReplaceYourArrayWith</li> <li>access it directly with [[yourSampleController param]addObject:(id)objectYouWantToAdd]...</li> <li>or more convenient : [yourSampleController.param addObject:(id)objectYouWantToAdd]</li> </ol> <p>The addObject: message here is an example, you can see the methods for modifying an array (remove, sort,...) in the NSMutableArray class reference.</p> <p>You will not be able to modify your string since it is a NSString and not a NSMutableString, but you can accessit by</p> <ol> <li>[yourSampleController getParam]</li> <li>[yourSampleController param]</li> <li>yourSampleController.param</li> </ol> <p>If you want to avoid leaks in general, build your project with the Instrument tool in leak mode and look at the objects that are leaked if you found some that are declared in your functions. You can also check the Clang Static Analyzer (free static debugger) which is quite good if you have a lot of files.</p> <p>I hope i helped you</p> <p>Julien</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload