Yesterday I updated to the newest iOS version and discovered that a crucial piece of my code fails to work properly.
// file is @"2/3/3-bottom-cen.png"
NSString *filePath = [[NSBundle mainBundle] pathForResource:file
ofType:nil
inDirectory:@"VillageImages"];
This code results in nil value for filePath and it happens only on iOS7 - the code works correctly on previous versions. I searched and failed to find any recent related problems so I'm asking here for any directions.
Just found out that apparently you can't include path information in the first argument for pathForResource:ofType:inDirectory:
anymore, just the file name.
i.e. 'working' syntax for iOS7 would be
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"3-bottom-cen.png"
ofType:nil
inDirectory:@"VillageImages/2/3"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With