#import <UIKit/>
***@interface ContactViewController : UITableViewController
***@end
#import ""
#import "" //人的模型
#import "" //男
#import "" //女
#import "" //跳转页面
***@interface ContactViewController ()
***@property (nonatomic,retain)NSMutableDictionary *dataSource;
***@property (nonatomic,retain)NSMutableArray *orderAry;
***@property (nonatomic,copy)NSString *str; //传哪个值
***@end
***@implementation ContactViewController
- (NSMutableDictionary *)dataSource{
if (!_dataSource) {
= [NSMutableDictionary dictionary];
}
return [[_dataSource retain] autorelease];
}
- (NSString *)str{
if (!_str) {
= @"name";
}
return [[_str retain] autorelease];
}
- (NSMutableArray *)orderAry{
if (!_orderAry) {
= [NSMutableArray array];
}
return [[_orderAry retain] autorelease];
}
- (void)viewDidLoad {
[super viewDidLoad];
// ment the following line to preserve selection between presentations.
// = NO;
// ment the following line to display an Edit button in the navigation bar for this view controller.
// = ;
[self readDataPlist];
}
- (IBAction)handleSegment:(UISegmentedControl *)sender {
= [sender titleForSegmentAtIndex:];
}
- (void)readDataPlist{
NSString *path = [[NSBundle mainBundle] pathForResource:@"yingxiong" ofType:@"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
for (NSString *str in dict) {
NSMutableArray *mArray = [NSMutableArray array];
for (NSDictionary *aHeros in dict[str]) {
Person *person = [[Person alloc] initWithName:aHeros];
[mArray
简单的页面跳转和传值. 来自淘豆网m.daumloan.com转载请标明出处.