的數據集下面是一個代碼,並朝着結束,我試圖找出方法來計算在部分我如何找到numberOfRowsInSection的對象
的NS對象定義
// DataDefinition的行數。 ħ #進口
@interface DataDefinition : NSObject
@property (nonatomic, retain) NSString *dataHeader;
@property (nonatomic, retain) NSMutableArray *dataDetails;
@end
顯示屏標題部分 //DataDisplay.h #進口
#import "DataDefinition.h"
@interface DataDisplay : UITableViewController
@property (read write) NSInteger RowsCount;
@property (strong, nonatomic) NSMutableArray *dataSet;
@property (strong, atomic) DataDefinition *individualData;
@end
顯示屏實現部分
//DataDisplay.m
@interface DataDisplay()
@end
@implementation DataDisplay
@synthesize RowsCount;
@synthesize dataSet;
@synthesize individualData;
- (void)viewDidLoad
{
[super viewDidLoad];
individualData.dataHeader = @"Header1";
individualData.dataDetails = [[NSMutableArray alloc] initWithObjects:@"Header1-Detail1", @"Header1-Detail2", @"Header1-Detail3", nil];
RowsCount = [individualData.dataDetails count];
[dataSet addObject:individualData];
.
.
.
[dataSet addObject:individualData];
self.title = @"DataDisplay";
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return [dataSet count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in sections.
return ?????
}
閱讀FAQ:HTTP://stackoverflow.com/faq,要麼接受我的答案或寫你自己的答案,並接受它,讓人們知道這個問題已經得到解答... – tiguero
我是新來的這個地方,很想接受你的答案。但是它需要按照Darren的寫法來糾正。順便說一句,我該如何接受你的回答 – user1509593