In the next feature, which is the best practice?
To send an auto-implemented object and force the caller to save it?
or send the selected object and make it the caller?
- (NSString *) convertDataToString: (NSData *) myData { // just an example, method might not exist NSString * str = [[NSString alloc] initWithData: myData]; return str; return [str autoRelease]; }
, - - . , . , , .
:
. , .
– (NSArray *)sprockets { NSArray *array = [[NSArray alloc] initWithObjects:mainSprocket, auxiliarySprocket, nil]; return array; }
, , . , . . , , , . , , .
@Chuck, -convertDataToString , . . "", "alloc" "new" , , . "" "" "alloc", .
-convertDataToString
Objective-C , . , .
. [alloc, new, copy], .
, , . , .
. , , , . . , , .
, : , , "create", "alloc" "copy", . http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html%23//apple_ref/doc/uid/20000994-BAJHFBGH
, autorelease, .
Source: https://habr.com/ru/post/1765001/More articles:Attempting to set graph in R - rSort JQuery table; problem with dynamically added rows - jqueryProblems with Microsoft Excel COM Automation - c #What does it mean to have uselongdouble undefined, but d_longdbl is defined in the Perl build configuration? - perlASP.NET MVC Razor Platform - asp.net-mvc-3Telerik Extensions for ASP.NET MVC - Effective Implications - performancejQuery (document) .width () does not include width outside the visible area - javascriptgrails - как заставить загружать файл с расширением - javaApi doc for Javascript 1.8.1? - javascriptDoes Rails Help Learn PHP Zend Framework - phpAll Articles