I was curious if there is a difference between the following two codes?
NSString * aString = [NSString stringWithString: @ "string"];
NSString * aString = @ "string";
I wonder what exactly happens when you do the last method.
Both point to a literal string created at compile time.
Even though stringWithString offers it autoreleased, a literal string will never be released.
See my sister post here:
Difference between NSString Literals
From Apple Docs @ https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/CreatingStrings.html
Such an object is created at compile time and exists throughout your program execution. The compiler makes such object constants unique on the basis of each module, and theyre never freed, although you can save and release them like any other object.
Source: https://habr.com/ru/post/1399941/More articles:Custom Calendar on iOS - iosCalling a script from another - delphiInfoWindow in api google maps javascript v3 - javascriptCovariance models with lme and gls - covariancejquery image slider with rectangular flow - jqueryHow does javascript (or a browser extension) detect the use of restricted functions? - javascriptDjango GIS ', covered in a query, returns an invalid result - djangoNested exception - java.sql.SQLException: Invalid column name ORACLE - javaSqlite3 table with a limited maximum number of rows (optional) - performanceWhy is this camera incapable of continuous braking? - mathAll Articles