分享

电话区号的选择

 萤火与皓月 2015-10-21
.h

#import <UIKit/UIKit.h>

#import "AreaView.h"

typedef void (^areaNumber) (NSString *);

@interface AreaViewController : UIViewController{

    AreaView *mainView;

}

@property(nonatomic,copy)areaNumber block;

@end


.m

#import "AreaViewController.h"

@interface AreaViewController ()


@end


@implementation AreaViewController


- (void)viewDidLoad {

    [super viewDidLoad];

    self.title = @"选择地区";

    mainView = [[AreaView alloc] initWithFrame:self.view.frame];

    __unsafe_unretained AreaViewController *thisSelf = (AreaViewController *)self;

    [mainView setBlock:^(NSString *result){

        thisSelf.block(result);

        [thisSelf.navigationController popViewControllerAnimated:YES];

        

    }];

    [self.view addSubview:mainView];

    

    NSString *path = [[NSBundle mainBundle] pathForResource:@"areaNumber.plist" ofType:nil];

    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithContentsOfFile:path];

//    NSArray *keys = [dic allKeys];

//    NSArray *resultKeys = [keys sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {

//        return [obj1 compare:obj2 options:NSLiteralSearch];

//    }];

    mainView.dic = dic;

}





plist文件




    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多