我想从以下网站读取我的应用程序中的Dbx文件。
http://www.weather.gov/geodata/catalog/wsom/data/bp03my11.dbx
我怎么能做到这一点?
任何建议或任何示例源代码
发布于 2011-06-21 15:46:36
由于"dbx“文件的格式类似于CSV (逗号分隔值),因此您可以找到解析CSV的代码,并将竖线符号("|")作为分隔符
以下链接是有关换行符分隔值 http://www.iphonedevsdk.com/forum/iphone-sdk-game-development/13753-tutorial-quiz-game.html#post64855的流的示例
您的尝试是先将换行符分开,然后再将|分开,并将其填充到NSArray / NSMutableArray / NSDictionary中
对于url,您可以访问它:
NSError* error;
NSString* text = [NSString stringWithContentsOfURL:TheUrl encoding:NSASCIIStringEncoding error:&error];请参阅:What is the "stringWithContentsOfURL" replacement for objective C?
或者使用ASIHTTPRequest简化步骤http://allseeing-i.com/ASIHTTPRequest/
https://stackoverflow.com/questions/6420831
复制相似问题