// ViewController.m
// 6.2(3) 简单表示图
//
// Created by 陈庆龄 on 15/10/22.
// Copyright © 2015年 陈庆龄. All rights reserved.
//
#import "ViewController.h"
#import "CustomCell.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;
@property (nonatomic,strong)NSArray *listTeam;
@property (nonatomic,strong)NSMutableArray *listFilterTeams;
//从plist文件中读取出来的数据
@property (nonatomic,strong)NSDictionary *dictData;
//小组名集合
@property (nonatomic,strong)NSArray *listGroupname;
-(void)filterContentForSearchText:(NSString* )searchText scope:(NSUInteger)scope;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//设置搜索栏委托对象为当前视图控制器
self.searchBar.delegate =self;
//设定搜索栏ScopeBar为隐藏
self.searchBar.showsScopeBar = NO;
[self.searchBar sizeToFit];
NSBundle *bundle= [NSBundle mainBundle];
NSString * plistPath = [bundle pathForResource:@"team_dictionary" ofType:@"plist"];
//获取属性列表的全部数据
self.dictData = [[NSDictionary alloc]initWithContentsOfFile:plistPath];
NSArray *templist= [self.dictData allKeys];
//对KEY进行排序
self.listGroupname = [templist sortedArrayUsingSelector:@selector(compare:)];
}<