In Objective C, is there a way to call reference a typdef enum from another class?
Posted
by Adrian Harris Crowne
on Stack Overflow
See other posts from Stack Overflow
or by Adrian Harris Crowne
Published on 2010-05-12T22:46:34Z
Indexed on
2010/05/12
23:04 UTC
Read the original article
Hit count: 302
It is my understanding that typedef enums are globally scoped, but if I created an enum outside of the @interface of RandomViewController.h, I can't figure out how to access it from OtherViewController.m. Is there a way to do this?
So... "RandomViewController.h"
#import <UIKit/UIKit.h>
typedef enum {
EnumOne,
EnumTwo
}EnumType;
@interface RandomViewController : UIViewController { }
and then... "OtherViewController.m"
-(void) checkArray{
BOOL inArray = [randomViewController checkArray:(EnumType)EnumOne];
}
© Stack Overflow or respective owner