////MAIN.M//English-Chinese Dictionary _ Tong Tong////Created by Chu Cowei on 15/8/5.//Copyright (c) 2015 jerehedu. All rights reserved.//#import <Foundation/Foundation.h> intMainintargcConst Char* argv[]) {@autoreleasepool {NSString*STR = [NSStringstringwithcontentsoffile:@"/users/jerehedu/desktop/dict.txt"Encoding:nsutf8stringencoding Error:Nil];Nsarray*aryall = [Str componentsseparatedbystring:@"#"];Nsarray*temp;nsmutabledictionary*dict = [nsmutabledictionaryDictionary]; for(intI=0; I<aryall. Count; i++) {temp = [[Aryall objectatindex:i] componentsseparatedbystring:@"\ntrans:"]; [Dict setobject:temp. LastobjectForkey:temp. Firstobject]; }NSString*seacher = @"adaption";NSLog(@"%@", [Dict Objectforkey:seacher]); }return 0;}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
oc-English-Chinese Dictionary 3 (dictionary)