Apple Bug Friday! 69

2007-08-31 20:46:56 UTC

This bug is Member variable is not an Objective-C term. It was filed on 2007-08-10 at 12:13 PDT.


Summary:

man 5 sdef claims that “member variable” is an Objective-C term.

Steps to Reproduce:

  1. Type “man 5 sdef” into the nearest Terminal.
  2. Read the Basics section.

Expected Results:

The table that maps sdef terms to programming-language terms maps “property” to “property” for Objective-C.

Actual Results:

The table that maps sdef terms to programming-language terms maps “property” to “member variable” for Objective-C.

Regression:

None known.

Notes:

The manpage actually says “member variable (C++/ObjC)”, suggesting that the author was only or primarily familiar with C++ and did not know that the correct term for the same thing in Objective-C is “instance variable”.

Regardless of the reason for the error, the correct term to map to AppleScript’s idea of a property is not “instance variable” either, but “property”. Tautological as it may seem, there is a difference, since an Obj-C property is not necessarily backed by an instance variable—it may be entirely based on accessor methods that wrap another property, a hidden instance variable, or a static variable.

A full explanation of this distinction isn’t necessary in the manpage; the manpage can simply note that Objective-C properties are defined in the Objective-C documentation. This is even more true in Objective-C 2.0, with the new @property syntax to easily declare an Objective-C property. The manpage can also provide a link.

Leave a Reply

Do not delete the second sentence.