xcode 8.2.1 (with swift) not loading external files - ios

I have a little problem with xcode. I've already seen this question/problem but the answers couldn't help me this time (yes, I've had this problem in the past).
So my problem is, that xcode is not loading my images/external files while testing/running the app.
If I put my images in xcode without folder, so just the images, it loads. But when I put them in a folder (and some sub-folders) , xcode can't find the images anymore when I'm running the app (in the storyboard it can finds them).
I've already cleaned the app and re imported the images.
Also it isn't a problem with just 1 project, if I start an all new fresh project, I have the same problem.
I hope I've explained my problem enough, if there are questions, I'll be more than happy to answer those.
Also if you can help me out, I will be thankful forever! This problem is really slowing down the development of our app.
Have a nice day!

Try putting the images into the .xcassets folder where your AppIcon is. Also, add files individually into the .xcassets and not drag a whole folder of images into the project.
Sorry for the short answer but you could add more information to the question like images of your folder structure and how you call the image

Related

Xcode crashed while renaming project - whole project broken

I wanted to release an app I worked on and quickly change the project name. I usually duplicate projects before doing things like this but this time - because this procedure always worked on Xcode as I found it way more reliable than e.g. Eclipse - I didn't, which I immediately regretted.
Opened Xcode again and now I am seeing this
I guess all the linking is gone now which is why Xcode doesn't "find" the files anymore. Renaming the remaining project stem to the old name gives
couldn’t be moved to because an item with the
same name already exists
and also manual renaming of folders won't work as the .xcodeproj is gone.
The project is written in Objective-C, and all the classes are still persistent, but the effort of adding all the xib's, referencing the outlets, setting architectures, etc will become the nightmare of my life. I do have a half-way recent backup but everything I did to make the app store-ready today will be gone.
Any ideas on how to rescue my project?
EDIT: What Xcode is now showing on the welcome screen is a project called "project" (literally) and it has the usual compass icon but with a white instead of a blue background referring to the path <project folder>/<new project name>/ and below that "white" project there is a folder icon with the new name pointing to <project folder>.
I also made a snapshot before, of course it now says "Unable to read snapshots" in the "restore from snapshots" window.
Ok what I now did is renaming ALL references from the old project name to the new one. I even changed file names. I used Xcode's CMD+SHIFT+F and TextWrangler's "replace" function and thankfully I still had the .xcodeproj from yesterday's backup so from there I could copy it into the new project and rename stuff. There are still some things that don't work perfectly, for example auto layout doesn't "stretch" contents over the screen (it stays on iPhone 4s size, even on 6 plus simulator), I needed to set the scheme again and Launch Images / Icons got lost but I can look over that. The only thing I am afraid of now is that the final build might miss out a symbol or something like that so I eventually have a corrupt file in the App Store, but man it's a beta version, how much worse can it get anyway?
Thanks to everyone recommending me to even backup the broken project, I did this even before you said it but because I think it's a valuable advice I wanted to put it in my answer as well.
It's a shame that stuff like this can happen, I've been backing up my work on a daily basis and my project never got corrupted - until now.

More FacebookSDK/Facebook.h issues - file not found

Alright, guys. I'm going freakin' crazy with this one. It is utterly ridiculous that the FacebookSDK causes so many issues. I know there are a couple questions on here regarding this issue, but they all seem to be outdated.
I pulled my Xcode project onto a new computer, and can't build it because I get the "FacebookSDK/FacebookSDK.h" file not found error. There are answers such as This one, but I've followed the steps in every single answer and haven't found one that works. I've just made a fresh pull from my working project from the original machine to the new one. I'll take some screenshots showing my current settings for various fields mentioned in other answers, and maybe I Just have something wonky that is interfering.
Here are the contents of the SDK that I just downloaded
Here are the contents of my Xcode project folder. There isn't anything else Facebook in here.
Here are the frameworks inside my Frameworks group and inside the Link Binary with Libraries section of Build Phases
There are a couple frameworks that are red, and that's OK for now. They were not in the repo, and are instead referenced from Documents or Downloads, and they played nice when I moved the files over and linked them. I just reset my repo to when I pulled it to make sure I didn't have anything from weird stuff I tried that prevents a proper solution from working.
Framework search paths. You can also see that my library search paths is empty. I labeled the stuff I wanted to hide, as it was identifying information
For some reason, my Documents for the new machine is already under the framework search paths. I did not add this myself.
Any ideas on what I can try? This is endlessly frustrating. I've wasted an entire day of development on trying to get Facebooks SDK re-integrated on a new machine.
I was also face the same problem every time I got the checkout for new version from svn.What I did was just removed the Facebook SDK and add again from the backup.It taken me out that time.Please try this might be it works for you.

Transferring an Xcode project to another computer with all files/frameworks

I am trying to copy over my Xcode project from one computer to another but it seems to lose frameworks and the locations for the images although i copied those too.
PS I am using xcode and coding an app with a friend. Is there a useful source that can help us both code at once/ transfer code files.
Thanks for the help.
Try transferring everything from plists to the storyboard. I did this with a friend of mine and it only took about 20 minutes for the code to build and run successfully on his own laptop. the biggest issue is going to be transferring the files that Xcode is going to have to search for, and making sure that the search paths match with where you save the new files.
SDK's and images are difficult because of this path issue - make sure you find where the pictures are supposed to be searched for then add the images there.
Just take your time - even write down where each file should go or where you have put it and you should get it working. Best of luck!
You have to select relative paths in your project for your resources/frameworks (e.g. Relative to group). If you have absolute paths, it won't work on a different computer. Also check in the Build Settings of your target the Framework, Library and Header search paths.

Xcode stalls on "loading" when trying to create new project

Xcode 6 never gets past "Loading" when I try to create a new project. I actually was able to create a new project yesterday, but I decided to just ditch it completely (deleted). Clearly there must be a bad file somewhere, possibly related to the project I deleted, since I also see the same stalling behavior now with Xcode 5.1, which has worked fine for creating new projects in the past. Xcode 6 has worked fine when starting with an already existing project and still appears to do so. I did not see this exact problem in your data base, though one person saw the project creation freeze before reaching the stage I get to. Their solution was to delete Xcode and every possible file related to it, which I'm a little squeamish about, since I don't want to affect existing projects, and don't have an understanding of what the various files are for.
Deleting the DerivedData of Xcode should fix the issue. You can do this by heading to ~/Library/Developer/XCode/DerivedData (with a Finder window open press cmd+G) and deleting all the subfolders of it.
This is embarrassing, but if it could happen to me, maybe it could happen to someone else. The problem was that the window that came up after the second step in defining the type of project to be created, the one in which you choose where to save the project's files, extended off the bottom of the screen, so that only the very tops of the buttons were visible. Eventually, I realized the one to the far right might be the one to click to continue. Which it was. Feel free to delete this question.

iOS still able to reference files after I remove them

I feel dumb for asking this, but I've spent like two hours trying to figure it out. I have a bunch of pictures that I included in my xcode project. I have them named background1.png, background2.png, background3.png etc.. I was renaming & messing around with the numbers of the photos and whatnot, and for some reason when I ran my code and I called [UIImage imagenamed #"background7.png"] I was getting background9.png instead. So I figured I have duplicate images in my project somewhere.
I deleted all the background images that I can find in my project. And when I run the code, even though I think they should all be gone, these images are still showing up. I opened up the finder and deleted any reference of background*.png I can find on my entire computer, and I tried moving the project to a different directory and it is still finding these photos. I thought that maybe the simulator/phone is caching the images so I deleted the app, didn't help. Any ideas on where these images might be hiding to where I can't find them anywhere but they can still be referenced?
You need to follow two simple steps :-
Clean your project. (Xcode->Product->Clean)
Delete application from device/simulator
Run again.
Hope this helps you..
You need to clean and build the project again. Press command + shift + K and then run(command + R) the code again. You can also try resetting the simulator or remove the app from there. If you are using device, you can remove the app from there.

Resources