【发布时间】:2010-05-12 22:46:34
【问题描述】:
据我了解,typedef 枚举是全局范围的,但如果我在 RandomViewController.h 的 @interface 之外创建了一个枚举,我无法弄清楚如何从 OtherViewController.m 访问它。有没有办法做到这一点?
所以... "RandomViewController.h"
#import <UIKit/UIKit.h>
typedef enum {
EnumOne,
EnumTwo
}EnumType;
@interface RandomViewController : UIViewController { }
然后... "OtherViewController.m"
-(void) checkArray{
BOOL inArray = [randomViewController checkArray:(EnumType)EnumOne];
}
【问题讨论】:
标签: objective-c scope global-variables enums typedef