Preliminary documentation for Ice 3.7.1 Beta. Do not use in production applications. Refer to the space directory for other releases.

A Slice enumeration maps to the corresponding enumeration in Objective-C. For example:

Slice
["objc:prefix:EX"]
module Example 
{
    enum Fruit { Apple, Orange, Pear }
}

The generated Objective-C definition is:

Objective-C
typedef enum 
{
    EXApple, EXOrange, EXPear
} EXFruit;

The metadata directive objc:scoped allows you to add the enumeration's name as prefix to all enumerators. For example:

Slice
["objc:prefix:EX"]
module Example 
{
    ["objc:scoped"] enum Fruit { Apple, Orange, Pear }
}

The generated Objective-C definition is:

Objective-C
typedef enum 
{
    EXFruitApple, EXFruitOrange, EXFruitPear
} EXFruit;

 

See Also

  • No labels