Please explain how to handle returned objects from methods?
Below I get employee details from the GeEmployeetData function with auto-advertisement,
Can I free * emp in a Process function?
- (void) Process {Employee * emp = [self GeEmployeetData]}
+ (Employee *) GeEmployeetData {
Employee * emp = [[Employee alloc] init]; // fill the object
return [emp autorelease]; }
In 99% of cases, you must save objects with auto-implementation returned from other methods if you want to save them.
, , release. 99% , retainCount , 1 .
release
retainCount
1
Source: https://habr.com/ru/post/1743447/More articles:What database table structure should be used for versions, code bases, deployments? - databaserelease with OOP class definitions - c ++Remove recently added item from list - listCalculating time before the 1st or 15th of a month in python - pythonскачать html файл в формате pdf с помощью abcpdf - htmlOO Design for Business Logic - c #Divide the string "A10" by char 'A' and int 10 - c ++jQuery: simple menu - javascriptPHP function is similar to this JavaScript function - javascriptExecuting Plain Html and javascript offline - htmlAll Articles