SA, 我所知道的是,Objective-C的是C的限制超..枚举在Objective-C对C
但是,当我尝试,我用在用一个非常简单的例子枚举C,它并没有在目标C的工作,
下面的代码:
#import <Foundation/Foundation.h>
int main(void)
{
typedef enum
{
SUN, MON, TUES
}DAYS;
DAYS d = MON;
NSLog(@"%@", d);
return 0;
}
#include <stdio.h>
int main(void)
{
typedef enum
{
SUN, MON, TUES
}DAYS;
DAYS d = MON;
printf("%d\n", d);
return 0;
}
在C,它完美的作品,但在objective-c(我在WIN上使用GNUstep)执行时崩溃(没有编译时错误)
有谁能告诉我为什么?