![这里写图片描述](https://img-blog.csdn.net/20170623160808772?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvR3VpR2VuX0w=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
1.具有搜索功能
![这里写图片描述](https://img-blog.csdn.net/20170623161154950?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvR3VpR2VuX0w=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
2.联系人主界面
#import "ViewController.h"
#import "First_ViewController.h"
#import "Add_ViewController.h"
#import "AppDelegate.h"
@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (retain) UITableView* tableView;
@property (retain) NSMutableArray* SourceArr;
@property (retain) NSMutableArray* SourceArr1;
@property (retain) NSMutableArray* resultArray;
@property (retain) UISearchBar* searchBar;
@property (retain) UISearchDisplayController* searchDisplayCtal;
@end
@implementation ViewController
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
UIApplication* app = [UIApplication sharedApplication];
AppDelegate* delegate = (AppDelegate*)app.delegate;
if (delegate.Linkman2.length > 0 && delegate.PhoneCode2.length > 0) {
_SourceArr[delegate.index] = delegate.Linkman2;
_SourceArr1[delegate.index] = delegate.PhoneCode2;
NSLog(@">>%@<<",_SourceArr[delegate.index]);
NSLog(@">>%ld<<",(long)delegate.index);
[ud setObject:_SourceArr forKey:@"relationUD"];
[ud setObject:_SourceArr1 forKey:@"numberUD"];
[_tableView reloadData];
}
if (delegate.Relation.length > 0 && delegate.Number.length > 0) {
[_SourceArr addObject:delegate.Relation];
[_SourceArr1 addObject:delegate.Number];
[ud setObject:_SourceArr forKey:@"relationUD"];
[ud setObject:_SourceArr1 forKey:@"numberUD"];
NSLog(@"qq%@qq",ud);
[_tableView reloadData];
}
delegate.Linkman2 = @"";
delegate.PhoneCode2 = @"";
delegate.Relation = @"";
delegate.Number = @"";
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.automaticallyAdjustsScrollViewInsets = NO;
self.navigationItem.title = @"联系人";
_SourceArr = [NSMutableArray new];
_SourceArr1 = [NSMutableArray new];
_resultArray = [NSMutableArray new];