I've been wondering why Apple uses data types in Core Foundation that are typedef'd to a pointer type while in Cocoa they are not.
As an example, you would reference a UIColor object like UIColor *
while a reference to a CGColor object would be CGColorRef
? Or NSURL *
and CFURLRef
? Why not just always use CGColor *
and CFURL *
? Or conversely, why no UIColorRef
or NSURLRef
types, since you never access a UIColor
or NSURL
directly anyway?
Or for example, why is it id
and not id *
, since it is actually a pointer and can in fact be typecast to void *
?
Specifically, is there some reason Apple had a habit of doing this in their older frameworks, but stopped doing it in Cocoa? Is it simply a matter of style?