I have a very simple data class that is subclassed from NSObject. I declare a few lines, make sure that they have properties (non-atomic, copies) and are synthesized. The only method I implemented was dealloc (), which releases my lines. Is this causing memory problems? Are there any other methods that I need to implement?
A subclass of NSObject is what we do all the time. Just follow the rules of memory management, and you are good to go.
init, - .
-(id)init { if (!(self = [super init])) return nil; // Set things up you might need setting up. return self; }
-, , - .
dealloc , .
. NSObject , 99% .
NSObject
NSObject , Cocoa/Cocoa Touch. , retain release ..
retain
release
, , . [super dealloc] -dealloc.
[super dealloc]
-dealloc
Source: https://habr.com/ru/post/1738415/More articles:AS400 SQL query with parameter - sqlIs there a difference in declaring an IDisposable member to use a block or when using a block declaration? - c #Clear all class variables between instances - pythonhEvent in structure OVERLAPPED Win32 - windowsAfter extending the User model in django, how do you create a ModelForm? - djangoPHP: documentElement-> warning childNodes - phpExecute a function every n-th second - javascriptJQuery: доступ к параметрам Post - jqueryWhat makes a project suitable for Azure / cloud? - cloudSyntax for specifying a namespace when using helper.RouteUrl - asp.net-mvcAll Articles