//
//  main.m
//  英汉词典_彤彤
//
//  Created by 邱学伟 on 15/8/5.
//  Copyright (c) 2015年 jerehedu. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSString *str = [NSString stringWithContentsOfFile:@"/Users/jerehedu/Desktop/dict.txt" encoding:NSUTF8StringEncoding error:nil];
        NSArray *aryAll = [str componentsSeparatedByString:@"#"];
        NSArray *temp;
        NSMutableDictionary *dict = [NSMutableDictionary dictionary];
        for (int i=0; i<aryAll.count; i++) {
            temp = [[aryAll objectAtIndex:i] componentsSeparatedByString:@"\nTrans:"];
            [dict setObject:temp.lastObject forKey:temp.firstObject];
        }
        NSString *seacher = @"adaption";
        NSLog(@"%@",[dict objectForKey:seacher]);
    }
    return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文:http://blog.csdn.net/qxuewei/article/details/47304235