2011-03-21 41 views
0
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
NSString *documentsDicrectory = [paths objectAtIndex:0]; 
NSString *filePath = [documentsDicrectory stringByAppendingPathComponent:@"libdata.xml"]; 
NSString *xmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL]; 

xml文件我保存在文件夾資源的XML文件(不小約140K的大小)在Xcode並試圖加載XML文件解析它。但xmlString獲取零。這段代碼有什麼問題? 在此先感謝目標C,無法加載存儲在資源文件夾在Xcode

回答