Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Using an enum in a Objective-C class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using an enum in a Objective-C class



Hi,

I have the following class and I cannot figure out how to return a value from an enumeration from one of its methods...

Any pointers would be appreciated!

//----------------------- foo.h
typedef enum tagPlayer
{
    None  = 0,
    White = 1,
    Black = -White
} Player;

@interface foo

-(enum Player) player;

@end

//---------------------- foo.m
#import "foo.h"

@implementation foo

-(Player) player
{
    return None;             // Compiler error: Player does not have a known size
}

@end

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.