編譯我的應用程序時,出現標題中提到的錯誤。我將如何去糾正這個錯誤?基本上,我想從一個桌子到另一個桌子。層次結構,導航。iPhone:error:請求成員'table'不是結構或聯盟
NextViewController.m
#import "RootViewController.h"
#import "NextViewController.h"
@implementation NextViewController
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}
- (void)dealloc {
[super dealloc];
}
- (IBAction) changeTable:(NSString *)str{
tblCSS.table = str;
}
最後一行包含錯誤。
如果您需要更多代碼,只需詢問。我會用它修改這篇文章。
乾杯, 傑克
NextViewController.h
#import <UIKit/UIKit.h>
@interface NextViewController : UIViewController {
IBOutlet UITableView *tblCSS;
}
- (IBAction) changeTable:(NSString *)str;
@end
您需要發佈定義'tblCSS'的頭文件(.h文件)的代碼。這就是你的問題所在。 – TechZen 2010-04-25 14:44:34
更新後的帖子用.h – 2010-04-26 16:09:35
UITableView沒有'table'屬性。您想做什麼? – kennytm 2010-04-26 18:33:17