0
votes

I am using the following code which is coming up with a warning. The code does display the correct image - but how can I get rid of the warning?

NSString *indexPath = [[NSBundle mainBundle] pathForResource:name ofType:@"png" inDirectory:@"tunes"];
NSURL *url = [NSURL encryptedFileURLWithPath:indexPath];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [[UIImage alloc] initWithData:data];

warning 'NSURL may not respond to +encryptedFileWithPath:'

1

1 Answers

1
votes

That is because NSURL does not have a method called `encryptedFileWithPath:'. If you have copied your code from here, you probably didn't read the article carefully enough:

If you are familiar with NSURL and its class methods then you may have spotted the unfamiliar encryptedFileURLWithPath: method. I have extended NSURL using a category to add this method as a convenience.