首页 > 其他 > 详细

city。plist

时间:2016-03-17 22:49:09      阅读:259      评论:0      收藏:0      [点我收藏+]

#import <UIKit/UIKit.h>

#import "FirstTableViewController.h"

@interface ViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>

@property(strong,nonatomic) UITableView *table;

@property(strong,nonatomic) NSArray *arr;

 

@end

 

#import <UIKit/UIKit.h>

#import "FirstTableViewController.h"

@interface ViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>

@property(strong,nonatomic) UITableView *table;

@property(strong,nonatomic) NSArray *arr;

 

@end

 

 

#import <UIKit/UIKit.h>

 

@interface FirstTableViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>

 

@property(strong,nonatomic)NSArray *arr;

@property(strong,nonatomic)UITableView *table;

@property(strong,nonatomic)NSString *str;

@end

 

 

#import "FirstTableViewController.h"

 

@interface FirstTableViewController ()

 

@end

 

@implementation FirstTableViewController

 

- (void)viewDidLoad {

    [super viewDidLoad];

    

//  设置导航栏的前景色

    self.navigationController.navigationBar.barTintColor=[UIColor grayColor];

//    设置导航栏字体颜色和大小

    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:30]}];

//    设置标题

    self.title=self.str;

//    初始化Table

    self.table=[[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];

//    设置分隔符的颜色

    self.table.separatorColor=[UIColor redColor];

//    设置代理

    self.table.delegate=self;

    self.table.dataSource=self;

    

    [self.view addSubview:self.table];

    

//    设置唯一标识

    

    [self.table registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];

    

}

 

- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    

}

 

#pragma mark - Table view data source

//行数

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

    return self.arr.count;

}

 

 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *cellIdentifi=@"cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifi forIndexPath:indexPath];

    

    cell.textLabel.text=self.arr[indexPath.row][@"city"];

    

    return cell;

}

city。plist

原文:http://www.cnblogs.com/tianlianghong/p/5289824.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!