¡@

Home 

2014/10/15 ¤U¤È 10:03:35

iphone Programming Glossary: allstudents

Table view basics and appearance like MS Excel

http://stackoverflow.com/questions/5040859/table-view-basics-and-appearance-like-ms-excel

MyViewController UIViewController UITableViewDataSource UITableViewDelegate Now suppose you have an array named allStudents containing objects of class Student which has three properties NSString name NSUInteger age BOOL male yes if sex is male.. the table view datasource and delegate methods NSInteger numberOfSectionsInTableView UITableView tableView return allStudents count NSInteger tableView UITableView tableView numberOfRowsInSection NSInteger section return 3 UITableViewCell tableView.. alloc initWithStyle UITableViewCellStyleDefault reuseIdentifier CellIdentifier autorelease Student current allStudents objectAtIndex NSIndexPath.section cell.textLabel.text current.name if current.male cell.detailTextLabel.text NSString stringWithFormat..