NSBundle *bundle = [NSBundle mainBundle];
NSString *pthpath = [bundle pathForResource:@"path" ofType:@"txt"];
NSString *content = [NSString stringWithContentsOfFile:pthpath encoding:NSUTF8StringEncoding error:nil];
array=[[NSArray alloc ]init];
array = [content componentsSeparatedByString:@"~"];
=====================================================================
這裏內容是:解析陣列元件
87348〜51347〜135132〜182133〜268346〜236347〜159168〜87347 @ 118298〜115297〜200298〜189266〜128265〜117299 @ 222352 〜268353〜264340〜219342〜225355 186262 @〜199299〜212297〜195257〜188260
和陣列是:
「87348」, 「51347」, 「135132」, 「182133」, 「268346」, 「236347」, 「159168」, 「87347 @ 118298」, 「115297」, 「200298」, 「189266 」 「128265」, 「117299 @ 222352」, 「268353」, 「264340」, 「219342」, 「225355 @ 186262」, 「199299」, 「212297」, 「195257」 , 「188,260」
但我想再次用@解析創建一個數組。請幫我...........
問題由隱形人/女人問。 – Bastardo 2011-06-14 07:44:04
請不要提出重複的問題,我已將第二個問題合併到此。 – 2011-07-08 01:46:32