2011-07-29 14 views

答えて

1

あなたは適切pathForResourceを実装していない:

NSString * string = [[NSBundle mainBundle] pathForResource"@"list-50.xml" ofType:@"xml"]; 

これは間違っています。

だから、私は、このやった

NSString * string = [[NSBundle mainBundle] pathForResource:@"list-50" ofType:@"xml"]; 
2

使用[[NSBundle mainBundle] pathForResource:@"myfile" ofType:@"xml"]パスを取得します。そこから、NSData、NSString、または他のクラスを使用してデータをロードできます。

+0

する必要があります:NSStringの*文字列= [リスト-50.xml」ofType:@ " "@"[NSBundle mainBundle] pathForResource XML"];し、その後のNSData *データを= [[NSData alloc] initWithContentOfFile:path];しかし、私は自分のプロジェクトにファイルを保存してそれをコピー先のフォルダにコピーしていません。 – Ashutosh

+0

'@" list-50.xml "'を使わないで ' @ "list-50" '.xmlは' ofType: 'の部分から来ます。 – jtbandes

関連する問題