Reputation: 2491
What is the old-style encoding mentioned in the Objective-C Property Type Encoding documentation?
t<encoding> Specifies the type using old-style encoding.
Also what is
The property is eligible for garbage collection.
mean. Is it related to the Garbage Collector that Objective-C once had or has to do with ARC retain counts?
Upvotes: 1
Views: 133
Reputation: 53000
What is the old-style encoding mentioned in the Objective-C Property Type Encoding documentation?
This appears to be a mystery. The only difference between the type encoding specified in the "Objective-C 2.0 Runtime Programming Guide" (Apple, 2009) which you are looking at and that given in "Object-Oriented Programming and The Objective-C Language" (NeXT, 1995) is the former has the addition of "B – A C++ bool
or a C99 _Bool
.
Further why would the property type string, which is a "string [that] starts with a T followed by the @encode type" further require a "t" later in the string which "Specifies the type using old-style encoding"?
If you are attempting to parse property type strings you already need to handle unexpected characters as errors – I'd suggest you just treat "t" as one such erroneous character.
Is it related to the Garbage Collector that Objective-C once had
That is what Apple usually means when they use the term "garbage collect(or|ion)" (other sources refer to "reference counting" as a kind of "garbage collection"), so it is reasonably safe to assume that here – "assume" because as is common in much of Apple's "specifications" the semantics of the "P" encoding do not appear to be defined anywhere and why the static property type string needs a repeat of information already provided by the type and attributes in the string is not explained.
Upvotes: 2
Reputation: 2947
I think they made slight changes to the type encoding format a long time ago (possibly when they went to ObjC 2.0 and added properties, back in the MacOS 10.5 time frame, or even earlier). I'm not sure I've seen the 't' actually used; it may be something used by the gcc compiler and not clang. The 'T' value is the type encoding which is used today.
For the second question, yes that is for the obsolete garbage collector.
Upvotes: 2
Reputation: 90521
Elsewhere in that same guide is the Type Encodings article. That explains the encoding your first question is referring to.
As to your second question, yes, it's referring to the obsolete garbage collector. It's not related to ARC.
Upvotes: 1