What is the alternative of [NSBundle mainBundle] URLForResource:withExtension: in iOS 3 SDK

拈花ヽ惹草 提交于 2019-12-03 16:04:53

its -

NSURL *aFileURL = [NSURL fileURLWithPath: [[NSBundle mainBundle]  pathForResource:path ofType:@"aif"]];

You can obtain path to your resource using pathForResource:ofType: method and then convert that path to URL using for example +fileURLWithPath: method in NSURL - both apis are available starting SDK 2.0.

NSString *path = [[NSBundle mainBundle] pathForResource:@"CoreDataApp" ofType:@"momd"];
NSURL *modelURL = [NSURL fileURLWithPath:path];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!