Objective-C standards document

后端 未结 3 1522
南旧
南旧 2020-12-29 04:56

I\'m a C and C++ programmer trying to get started with Objective-C. I\'m really bewildered, though, by the apparent total absence of a standards document for the language an

3条回答
  •  有刺的猬
    2020-12-29 05:22

    Unfortunately there is no Standard for ObjC as there is for C++ or C. Apple being the main user and driver behind the language, their compiler implementation (the ObjC bits of Clang) is the de facto Standard. Their old document (broken link) "The Objective-C Programming Language" was about as close as you got to a prose version, and it was nowhere near the precision of either of those other languages' Standards (and it tends to lag behind the compiler).

    It may still be floating around on the web somewhere, but it is no longer up-to-date. "Programming with Objective-C" seems to be their intended replacement (but again, it's nothing like a standard).

    Regarding your comment (10k link only) under Tim's deleted answer, the Cocoa root class is NSObject, and its interface is documented, but its source is not available. Note that the NSObject protocol is also an extremely important part of a Cocoa object's functionality. Apple's runtime is open-source,* and has a root class called Object, I assume for purposes of demonstration. It's not used in Cocoa programming.

    You already know about all of this, of course. The direct answer to your question is, "there isn't one". Most of the syntax is the same as C, though, as bbum points out: Authoritative description of ObjectiveC string literals? (yes, I copy-pasted my comment from there into the beginning of this answer).


    *Note that contrary to what you say in your question, this is the actual, up-to-date, runtime.

提交回复
热议问题