[問題] global variable
各位好
請問如何宣告global的variable
我想在不同的class之間能夠存取某隻專門記錄global variable的class
我的Global.h檔
#import <Fouondation/Foundation.h>
extern BOOL flag;
@interface Global :NSObject
{
}
@end
我的.m檔
#import "Global.h"
@implementation Global
BOOL flag =NO;
@end
然後我在我使用這個global variable的class import Global.h
直接對他存取
可是編譯完後發現Global.m檔都會出現
Incomplete implementation的警告
請問該如何修正呢?
再請教如果要使用global variable的話
用 @property與@synthesize 該如何使用
剛入門 請指教 謝謝大家
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.251.164.88
→
04/03 18:59, , 1F
04/03 18:59, 1F
→
04/03 19:00, , 2F
04/03 19:00, 2F
→
04/03 20:55, , 3F
04/03 20:55, 3F
推
04/03 21:21, , 4F
04/03 21:21, 4F
→
04/03 21:26, , 5F
04/03 21:26, 5F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章