- Question about Xcode 12.5 Clang compiler release notes.
Re: Question about Xcode 12.5 Clang compiler release notes.
toggle quoted messageShow quoted text
Oops. Sorry. new and alloc are +, but init is definitely -. You are right +init is an error.
So, file a bug report? ;-)
No. It is correct. Both new and alloc are + methods since they act on the class, and not an object. If you think about it, there is no object to message when you use them.
From the docs:
This method is a combination of
alloc, it initializes the
isa instance variable of the new object so it points to the class data structure. It then invokes the
init method to complete the initialization process.
From the release notes
> Clang now infers the availability of
+new from availability annotations on
[[Foo alloc] init],
+new isn’t available unless
+init is available. (75884815)
+init? Is this a typo in the release notes??
Thanks in advance.
Join firstname.lastname@example.org to automatically receive all group messages.