I have a question about initializing NSMutableString for objective-c.
NSMutableString*ms1 = NSMutableString string;
NSMutableString* ms2 = [[NSMutableString alloc] init];
NSMutableString* ms3 = [NSMutableString new];
Yes.
So I have a question.
·What is the ideal initialization method for objective-c?
·Also, why is the initialization method good?
That's all, thank you.
ios objective-c
Any environment where ARC is enabled is the same.There is no change or difference.
The method new
is a shortened form of alloc
+ init
, so-called "Syntax Sugar".
There was a difference between alloc
+ init
and string
where alloc
+ init
+ autorelease
is an abbreviated format.
582 PHP ssh2_scp_send fails to send files as intended
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.