iOS still able to reference files after I remove them - ios

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.

Related

xcode 8.2.1 (with swift) not loading external files

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

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.

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.

Storyboard Suddenly GONE from Xcode

While I was working on this Xcode project, compile and run an app, the two files suddenly gone!!!
It was working fine and I run the app a few times already. Anybody has any clue why is it happening?
My Mac is warning for Disk Space recently. Would it be something related?
Please help...I have been working on the project for a few weeks already. Anyway I could recover what I lost? I archive it a few hours ago into an IPA, can I recover the lost files from there?
Thanks a lot.
EDIT-------------------------------------
The Files are gone and I have to work for 12 hours to get my app back to running as it was before.
I think the problem was that my Mac was out of Disk Space, and when I tried to run, the AutoSave from Xcode failed to save. And for some reason the failure caused Xcode the delete the file when saving failed.
Learning from the lesson. I will do what folks here suggested from now on:
1) Time Machine
2) Git
3) Periodic zip the project and put on Dropbox and an external hard disk
4) Always ensure there's enough disk space
Thanks all. Hope nobody else would have to go through what I went through.
1) Are you using "Time Machine"? If not, consider this a wake-up call.
2) Use Spotlight (the magnifying glass in the upper right corner of your Macintosh menu) to find those missing files.
3) Once you do find them, delete the old files and re-add them to your project, making sure the "Target Membership" checkboxes are set.
Disk space warning is a good indication that things of this sort could happen. Some say you need to have %50 of the disk free. Whether it's true or not, filling the disk to the point system warning is a serious sign that you should free up enough space.
Sometimes a restart can magically 'find' a file, but I'm sure you tried that already. I'd try to find it in the project folder, or on the disk itself and not through XCode.
Most chances are the files are there, but XCode cannot see them for some reason.
Have you looked in the projects directory?
Also are you using source control (Locally or git) ?
I had the same problem, some of my views on the storyboard disappeared after Xcode crashed. After looking for a while for an answer I noticed the view still shows on the hierarchy panel. checking its properties I noticed that Xcode had changed my width and height properties to 0. Once I restored them, the view shows again. Long story short, check the properties, if the width and height are 0 the view becomes invisible.

Old version of image shows up in iPhone Simulator even after removing the app cache

I can't figure this one out. I've got an iPhone-only app with an image -- location.png -- that has had two versions since starting the application. When I build the app for my actual phone, I get the new version of the image. When I build it for the simulator, however, the old version of the image shows up.
I've dealt with this type of thing before, and usually how I resolve it is by removing the entire folder containing the application and cache from ~/Library/Application Support/iPhone Simulator/X.X/Applications/. That has always worked up until now, when I'm still getting that pesky image after deleting that cache multiple times. It's not really a huge deal, I'd just like to know how to get rid of it for my own sanity (or in case I need to do it again in the future in a case where it matters more). Any ideas?
I performed a Clean (Product -> Clean in Xcode) as per Msencenb's advice, and that resolved the issue. I'll leave the question up in case someone else has the same problem.

Resources