下面是一个代码,接近尾声,我试图找出计算部分行数的方法
NS 对象定义
//DataDefinition.h #import
@interface DataDefinition : NSObject
@property (nonatomic, retain) NSString *dataHeader;
@property (nonatomic, retain) NSMutableArray *dataDetails;
@end
显示标题部分 //DataDisplay.h #import
#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 ?????
}