开发者

Why doesn't the compiler recognize the -URLForResource:withExtension method on NSBundle?

I downloaded the code for Apple's ZoomingPDFViewer sample application, but I am unable to compile this application. It's showing a warning for this line

NSU开发者_开发问答RL *pdfURL = [[NSBundle mainBundle] URLForResource:@"TestPage.pdf" withExtension:nil];

NSBundle may not respond to URLForResource:withExtension

I build using the iPhone OS 3.2.1 SDK. Why is it giving me this warning?


URLForResource:withExtension: method is available starting SDK 4.0. In older systems you need to use other methods, e.g. obtain path to the resource file using pathForResource:ofType: method first and then convert it to NSURL

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜