Reputation: 27618
This has to be the worst bug I ran into with Xcode 7.
In previous versions of Xcode 6 or below, if I needed to add my pngs, jpgs to a project then I would do Xcode -> File -> Add files to Project -> select a folder where I had all my images in and add that. I was then able to use those images using code
NSString* headerStr =[NSString stringWithFormat:@"button_black.png"];
UIImage *myImg = [UIImage imageNamed:headerStr];
NSLog(@"myImg: %@ ...", myImg);
Now check this out, if I try to add my pics folder in Xcode 7 it shows up blue. Why is it blue? If I try the code above then nslog displays
myImg: null ...
I mean what is going on? It never displayed any of the images I added.
Just for the heck of it I deleted that blue folder and created a new folder in my project by doing right click -> New group and then added all the pics to it and then it works. Is this a monster bug with this great Xcode 7?
Upvotes: 0
Views: 122
Reputation: 1444
Because you are adding your folder as reference thats why its shown in blue.
Delete the "pics2" folder. And try to add the folder again inside the project and select below options.
Upvotes: 3