i've a little problem, i've add a default.png in my app and it work.
I've modify my file, delete file and reference and upload my new file.
On my iphone the image does not appear, only some second of blackscreen and after my app start. In the simulator the splashscreen appear.
I've try to delete my app on iphone, make a clean all and rebuild & install but nothing...
I've try to make clean all, close xcode, delete default.png to my project directory (sometimes exist, sometimes no), open xcode, add my file and build & install on my iphone but nothing...
Any ideas?
partially resolved, i've delete my file and reference, check if it's delete in my project directory, readd file BUT in other directory and it works, i think there will be some reference to my splashscreen that i cannot found.
Is your Default.png file capitalized? The iPhone uses a case-sensitive filesystem. Not sure if that would cause the problems you're having, but it's worth checking on.
Related
For some reason, XCode is acting up really oddly. I have been testing XCode's ability to load images with the -hd suffix, and realized that Xcode will load a file "welcomeBackground.jpg" regardless of whether it is actually in my project folder.
See, this code below will not crash when compiled. And this is the first screen that is displayed when the app loads. I deleted the file "welcomeBackground.jpg" from my project folder, and XCode still loads the file as if it were there.
This is really freaking me out. Please help?
I am 200% sure I deleted the file from my project folder even and yet Xcode does not crash on line 35.
EDIT: To repeat, things I have tried/checked
- Cleaned project
- Deleted Derived Data
- Checked for hidden files in project folder
- Deleted app from iPhone and re-run from XCode
- Deleted the files from my project folder
- Loaded another image "sadhieia.png" and crashed Xcode
because Xcode couldn't find the file (as it does not
exist), and then tried "welcomeBackground.jpg" again
and Xcode somehow finds it.
And yet, the background still loads...
In Cocos2d, if the specified image is not in your folder, it'll not crash. Instead, it'll return nil to your CCSPrite *background.I suggest you Don't use Camelcase for images. Use lowercases or underscores. Try deleting Derived Data. See this for how to delete derived data.
Scroll the project navigator down to the bottom, to "Products," then click the disclosure arrow to show your application.
Right-click the application and choose "Show in Finder" from the contextual menu that appears. A Finder window is displayed containing your application.
Command-click the title of that window; another contextual menu appears. From that, choose the folder "Derived Data." The Finder then displays a window for that folder.
In this window, you'll see a folder whose name is that of your application, followed by a long string of letters. Trash it. If you see multiple folders bearing your application's name, trash them as well.
Rebuild your project. That should take care of the issue.
This might be a slash and burn approach, but it's solved a lot of quirky project-related issues I've experienced in Xcode after attempting to clean.
Clean your project; your image file is still cached in the build folder.
In my project summary, I dropped an image in Launch Images place. Which started shown as splash screen when application starts.
Now I have deleted it and there is no Default.png in my project folder. But still that image is being shown as splash screen.
How I can remove it?
Any idea .... ?
Have you tried doing a clean build?
or deleting the app from the device/simulator and re-deploying it?
Most likely, all you need do is clean the project, then rebuild.
To clean the project, simply press cmd+shift+K. Then, build as normal.
To illoGicalError
doing clean and Build will not remove it.
You need to delete the application on your simulator ,then run your application again... It will work...
Press Command+K then build and run. This will remove all unused images from your build.
You can also get to this command from the project menu bar
Try deleting the .app from the Products folder in your Xcode sidebar.
But generally, don't worry - Xcode just likes to cache things like this - if you build for the device then it won't be there.
When I run my app in the simulator it does load the xib file and all looks perfectly fine. As soon as I run in on my iphone4 I get a white page with "My Universal App on iPhone" but not my xib file.
how comes?
Try this: Clean all targets, delete Build folder and uninstall app from device.
It happened to me once too. Try to clean your project (cmd+maj+K).
Try to use the function InitWithNibName:#"YourNibName" without misspelling in YourNiBName.
Good luck
Check that the .xib file is still part of your project and set as a resource to copy at build time. This sort of thing tends to happen if you've removed a file from the build resources but there's still an old copy in the simulator's build directory.
This one has me confounded, so I'll try to go through the chronology so someone smart than I am can show me where I'm going wrong.
Everything was working perfectly on my app, both on the device and on the simulator. I have an image file, myimage.png, that is located in the directory where my project is and has been added to the project. It shows up in XCode and everything.
I build, run, and things work as planned.
Then I decided to get clever in photoshop and spruce up my image with a bit more color. In the finder, I deleted myimage.png from the directory where my project is located. Then I saved the new image as myimage.png in that very same directory. Back in XCode, the file shows up in the project and looks just as nice as planned.
I build, run, and no image shows up. WTF??!?
Here are my two questions, in order of importance:
How do I fix this so that my image shows up again?
What have a done wrong in this process?
Thanks!
EDIT: Here is the code where I am calling the image. In myViewController.m:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// SOME CODE THAT DOES OTHER THINGS UNRELATED TO imageView
[imageView setImage:[UIImage imageNamed:#"myimage.png"]];
// MORE CODE THAT DOES OTHER THINGS UNRELATED TO imageView
}
ANOTHER EDIT: Not one single character of my code changed between the app working and not working. I appreciate all of the suggestions since I clearly cannot figure this one out on my own, but the problem is most likely not with the code.
easy: in xCode delete the file reference and the files themselves and then import it again...
mhm... when you changed your image was xCode opened? it may have seen somehow it's been deleted and lost the link... if you change it xCode could "choose" to NOT include it in the target mainBundle when you build your project... in xCode select the file and see if the checkMark on target is selected:
if not it won't be included in you app (and this answers to your n:1 question too)...
maybe a better way to add a resource files which could be probably be modified by other programs in future while yourProject could be opened (i do it with an html site to be included, jpg and gif too) is to put them in a subFolder of your project and then add all that folder to your xCode project AND in the dialog window choose:
"create folder references..."
that will create a blue folder in xCode and all its contents will refresh automatically if you change, add, delete files or subfolder inside it...
BUT remember that the subFolders will exist in the same tree-order in your app mainBundle, so if you need to load a .png you need to specify where to find it.
PS
check also that the file name is exactly the same of the old file, including UpperCase chars
("a" != "A")
I think that happens because Xcode doesn't know that the file has changed. Always add/remove files in the project navigator.
It should work if you clean your project and build again.
You'll need to do a Build -> Clean. And the rebuild.
I'm having some weird issues with Xcode, and this is pretty much impossible to find answers by simply googling around.
I have a few icon image files (just PNGs) in my Xcode project, and when I modify some of them in Photoshop, they don't get updated when I do another build in Xcode. In order to fix this I have to re-add the file again to the project, and then remove the old version of the file that is already in there in Xcode.
What am I doing wrong here? I'm updating/replacing the image file that is stored in my project's directory directly from Photoshop, so I assumed that it would just get reloaded and the new version would show up.
UPDATE: Looks like what happened was that when I first imported the image files into my project, they got added to my "Classes/" sub-directory. So when I was updating them, it was just adding them to the root of my project.
I had the exact same problem.
The following fixed it for me:
In Xcode, go to Project --> Clean
This will purge the old images from xcode cache and will show your new image
That's pretty weird. I'd suggest two things:
Check that you're not saving your
photoshop files into the wrong
directory. I know this seems
straightforward but its worth a
check. Make sure you're not saving
them into the build/ directory or
anything like that.
Before running again in the simulator, try cleaning all build targets first to ensure that your project actually builds again before launching the simulator.