开发者

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

开发者 https://www.devze.com 2023-01-22 17:52 出处:网络
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

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

精彩评论

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