The Objective-C mapping for optional data members in Slice classes and exceptions adds an extra boolean instance variable as well as two selectors for testing if the optional is set and clearing its value. The argument for the optional data member in the convenience constructor is mapped according to the optional parameter mapping for Slice operations. Consider the following Slice definition:
The generated Objective-C code provides the following API:
Note that calling a
get method or accessing the property when the value is not currently set returns an undefined value.