環境
XCode 4.6.2
OSX 10.7.5
NMFoo.h
typedef void(^NMFooBlock)();
struct NMFooStruct {
__unsafe_unretained NMFooBlock fooBlock;
};
typedef struct NMFooStruct NMFooStruct;
@interface NMFoo : NSObject
@end
NMFoo.m
#import "NMFoo.h"
NMFooBlock const NMFooBlockConst = ^{};
NMFooStruct const NMFooStructConst = { .fooBlock = NMFooBlockConst };
@implementation NMFoo
@end
が得られます
エラー: 初期化要素はコンパイル時の定数 NMFooStruct const NMFooStructConst = { .fooBlock = NMFooBlockConst } ではありません。
NMFooBlockConst が const として定義されていても、それは期待される動作ですか?