I am trying to edit rawURL
so that it looks in the correct folder within my application bundle. I looked at Apple's documentation, but when I opened up my application's .xcdatamodeld
, the attribute whose String value I'm looking to edit, didn't appear to be set to anything:
I looked in the entire code base, and I couldn't find it set anywhere programatically. However, I put a print statement in the code I'm looking to change, and it does in fact print a string. I want to change the value of this string so that it looks in FindSpecies/[species name]/[img file]
not FindSpecies/species/[species name]/images/[img file]
.
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString* cachePath = [paths objectAtIndex:0];
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
NSLog(@"self.rawurl: %@", self.rawURL);
NSString* stringURL = [self.rawURL stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSLog(@"stringURL: %@", stringURL);
NSURL* url = [NSURL URLWithString:stringURL];
NSString* path = [url path];
NSString* query = [url query];
//...
returnString = [NSString stringWithFormat:@"%@/%@%@", resourcePath, kThumbnailDirectoryName, path];
Can I edit rawURL
if I don't even know where/how its set in the first place?
EDIT: This app was built in 2011 by my professor's former grad students. I am in the process of modernizing it.