To localitie items in the standard directories, I have just used either one of these:
NSURL* url = [[NSBundle mainBundle] URLForResource:@"search" withExtension:@"png"]; NSString *path = [[NSBundle mainBundle] pathForResource:@"search" ofType:@"png"]; The output is:
url is file://localhost/Users/myName/Library/......./MyApp.app/search.png path is /Users/myName/Library/......./MyApp.app/search.png The difference between the two of them is the missing file://localhost.
My question is when should we use URLForResource and when we use pathForResource?