views:

44

answers:

1
typedef enum {
    kA = 0,
    kB,
    kC,
    kD,
    kE,
    kF
} index;

@interface myViewController : UITableViewController<UIAlertViewDelegate> {
    index enumIndex;
}

Hi, guys.

I declare index which is composed by typedef enum. But I didn't found code like that. and If that code useful, does not need to release ?

I don't understand typedef enum in Objective C.

Please help me.

+1  A: 

typedef enum works exactly the same in Objective-C as it does in C. There is no difference.

If I were to hazard a guess as to the compiler error that you didn't provide, I'd bet that index is already defined and it is complaining about redefinition. In any case, make your typedef comprehensible, say MyViewControllerIndex.

Note also that your class names should start with capital letters; MyViewController.

bbum