I am rereading the first few chapters of Cocoa Programming for Mac OS X, and the author claims that one of the methods of the class NSCalendarDatereturns an object with auto-implementation. I always assumed that all methods of the class return an auto-implemented object (since there is none alloc).
NSCalendarDate
alloc
Are there any class methods that you should specifically keep?
Thanks.
Class methods, like instance methods, must adhere to Cocoa standard memory management rules .
, , , "alloc" "new" "" (, alloc, newObject mutableCopy), . . , .
, - . , "alloc" "new" "copy". , , iVar - .
. . [NSMutableArray array] [[[[NSMutableArray alloc] init] autorelease].
, , , . . menthod alloc *, copy, new * name, . 1 .
, , - - ( , ..) (void). Objective-C , , ( , / ).
, @Joey . , , , . , .
General rule: if the method name contains alloc, new or copy, then you own it. Otherwise, it can be auto-implemented or taken care of by someone else, that is, you do not own it, so you do not need to worry about it.
Source: https://habr.com/ru/post/1716886/More articles:select a file by clicking on the image? (not with browse button) - inputfunction to get an array of arbitrary type in C # - objectSeparation of intervals in weeks in Postgres - datePython dictionary for storing socket objects - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1716885/how-to-write-strings-as-binaries-to-file&usg=ALkJrhhii7AA55FSyKGzqyQZ6yftOz6gTwLoaded PDF from Java is corrupted? - javaiPhone: Is it worth developing an application to support OS 2.2? - iphoneHow to get SessionID by request, where EnableSessionState = "False" - asp.netUsing Files with Multiple Glades: GtkBuiler - gtkIs it possible to set a conditional breakpoint at the end of a function based on the return of the function? - debuggingAll Articles