Cocoa touch 三张桌子在同一个窗口,iPad
嗨,我正在开发一个应用程序,在横向模式下, 我需要在同一窗口中显示3张桌子, 如何做到这一点? 作为我的视图控制器,我有一个表>Cocoa touch 三张桌子在同一个窗口,iPad,cocoa-touch,ipad,uitableview,uikit,uiviewcontroller,Cocoa Touch,Ipad,Uitableview,Uikit,Uiviewcontroller,嗨,我正在开发一个应用程序,在横向模式下, 我需要在同一窗口中显示3张桌子, 如何做到这一点? 作为我的视图控制器,我有一个表> @interface ChoiceViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { NSMutableArray *array; } @界面选择ViewController:UIViewController { NSMutableA
@interface ChoiceViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
{
NSMutableArray *array;
}
@界面选择ViewController:UIViewController
{
NSMutableArray*数组;
}
但是如何在xib中连接新表呢?如何调用其他委托、数据源、,
用于创建新表的Uitableview
谢谢大家! 在视图控制器的界面中添加IBOutlets:
@interface ChoiceViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
{
UITableView *table1;
UITableView *table2;
UITableView *table3;
NSMutableArray *array;
}
@property(nonatomic,retain) IBOutlet UITableView *table1;
@property(nonatomic,retain) IBOutlet UITableView *table2;
@property(nonatomic,retain) IBOutlet UITableView *table3;
@end
在UITableViewDelegate/UITableViewDataSource方法中,测试哪个表视图请求数据并返回相应的数据
或者,您可以设置多个数据源,每个数据源负责一个表视图,但这取决于应用程序的设计。您好,谢谢,我尝试了这种方法,但出现了一些错误,这种方法可以在每个表中放置不同的数据吗?特克斯。如果视图控制器对要在表中显示的数据具有逻辑访问权限,则它是有意义的。否则,最好使用不同的数据源/委托。你看到了什么样的错误?
@implementation ChoiceViewController
@synthesize table1, table2, table3;
- (void) dealloc
{
self.table1 = nil;
self.table2 = nil;
self.table3 = nil;
// Most likely, [array release];
[super dealloc];
}
@end