嘿,我一直在試圖找出爲什麼我收到這樣的警告:訪問全球varibile任何類
「TxtAppDelegate」不能爲「-TCN」 「TxtAppDelegate」迴應可能會不響應以「-TID」
,當我嘗試使用此代碼:
// .h file
@interface RootViewController : UITableViewController <UIActionSheetDelegate> {
NSString *theCompanyName;
NSString *theID;
}
@property (nonatomic, retain)NSString *theCompanyName;
@property (nonatomic, retain)NSString *theID;
// .m
NSString *theCompanyName;
NSString *theID;
@synthesize theCompanyName;
@synthesize theID;
TxtAppDelegate *customObjInstance = [[TxtAppDelegate alloc] init];
theCompanyName = [customObjInstance TCN];
theID = [customObjInstance TID];
我已經添加了,在他們有兩個功能.h文件頭。代碼有效,但我真的想解決警告問題。
任何幫助將是巨大的,解決礦山:)
大衛
是的,謝謝。我忘了那個! :O) – StealthRT 2010-02-26 19:12:37