What Matt said, but there is a bit more.
typedefs in the C-based API also allow you to hide implementation details. For example, you may have the following without defining the __CFURL structure in the public header.
typedef __CFURL *CFURLRef;
Objective-C has long had such functions in the form of categories, and recently added the ability to transfer instance variable declarations from the header file. Expect that over time, you will see all instance variables deleted from the public header files in the SDK.
Note that Cocoa frames are long, long, predefined by CoreFoundation.
As to why id used instead of id * , this dates back to when Objective-C was first created in the early 1980s. In particular, the concept of language was that you would build “software integrated circuits” that could be “plugged in” like real IPs. The goal was to save the C bit as implementation details and, ideally, not display in your APIs.
As for why you end up with NSString * instead of NSString , it's largely because of the C-bases of the language. I wrote a fairly detailed answer to a slightly different SO question that matters.
You will probably also find this answer .
bbum
source share