【发布时间】:2011-09-14 11:25:55
【问题描述】:
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:@"~"];
=====================================================================
这里的内容是:
87,348〜51,347〜135,132〜182,133〜268,346〜236,347〜159,168〜87,347 @ 118,298〜115,297〜200,298〜189,266〜128,265〜117,299 @ 222,352〜268,353〜264,340〜219,342〜225,299 @ 186,262〜199,299〜212,297〜195,257〜188,260
数组是:
"87,348", "51,347", "135,132", "182,133", "268,346", "236,347", "159,168", "87,347@118,298", "115,297", "200,298", "189,266", "128,265", "117,299@222,352", "268,353", "264,340", "219,342", "225,355@186,262", "199,299", "212,297", "195,257", “188,260”
但我想通过@解析再次创建一个数组。请帮帮我............
【问题讨论】:
-
隐形男/女提出的问题。
-
请不要问重复的问题,我已经将第二个问题合并了。
标签: iphone arrays parsing coordinates