Resource file in iPhone app problem - objective-c

I have an image which is added to the project. In the simulator it appears, but when I build for the device the resource is not included. I also started a new project and nothing. Please help me. What can be the problem?

Please check the extension of image file you are using. This happened with me , I was using .png format in project but file was in .jpeg format

Are you sure you copied the image into project, xcode ask to copy the file in project when you drag file in resource. Also check for your file name is correct (check for case sensitive ).

I deleted the image file and created a new file with the same image and it works... I think it was a bug of the file...

Related

In a Cocoa Application for macOS, I save a bundle to disk using NSFileWrapper. How can I get the finder show the correct icon for my bundle?

In a Cocoa Application for macOS, I save a bundle to disk using NSFileWrapper. The Bundle is correctly saved and recognised as a bundle (Show package contents appear) but I cannot get the finder display the Icon I provide for the bundle. Here are my settings for the imported/exported UTIs:
Unfortunately, the bundle appears always with a blank file icon:
As you can see, the Finder recognises the file kind, but does not display an image for it. Any help is greatly appreciated. Thanks
In the Exported UTIs section, try setting Conforms To to com.apple.package, public.archive.
I'm no UTI expert, but that has always worked for my apps.

How to get the path of the image stored in the resources folder of a project in winforms

I have some images stores in the resources folder of a project as shown. I am able to find the images through My.Resorces.arc1/arc2/arc3 but i am not able to locate the image called directions2 stored at the same resources folder.
Can anyone please help me on this
1.Check your image file have proper file extensions [.jpg,.png etc]
2.Rebuild your project and try again.
The path is shown in Resource file. See the

Cocoa Application on remote files?

I have created a small application that selects the files and renames spaces into underscores and few other symbols. It works fine when I tried with the files on my desktop but it fails to execute when i try with files on my remote server. The problem is it doesn't show any signs of error. In my application, once the files are renamed, I will get a notification on my app stating the number of files renamed. It does show that the file is renamed but I couldn't find the renamed files. Any suggestion as to why it happens or any fixes for this please.
I have created the application and exported as a Mac Executable Application.
Solved: NSFileManager recognises file paths in different formats so we need to change according to the default path format with which Mac recognises and update files. I changed accordingly and it works. Thanks for you help.

Property list not copied into document directory

I have manually created a property list (Config.plist) using Xcode 4.3 and saved it in "Supporting Files/Config.plist".
However, when building the project and running the app in the simulator, the property list is not copied in the document directory (as supposed) nor any other directory in the simulator.
Any help would be highly appreciated.
Thank you!
It will go to NSBundle mainBundle by default. You will require to copy that file to document directory. Check my code for copy file to document directory over here:
Plist

Intellij Idea problem with text file impossible to read

I have a problem using Intellij Idea.
I am absolutely unable to load text file as InputStream - it doesnt matter where do I put the file (main/java, main/resources...) it just can't find the file - in Eclipse everything works just fine.
I tried setings->compiler->resource patterns and added ?*.txt but that doesn't seem to work either.
Any help is appreciated.
If you load it as a File, make sure that Working Directory is properly set in IDEA Run/Debug Configuration, since it's the default directory where Java will look for a file when you try to access it like new File("file.txt"). Working directory should be set to the directory of your project containing .txt files.
If you load files as a classpath resource, then they should reside somewhere under Source root and will be copied to the classpath according to Settings | Compiler | Resource Patterns.
If you can't get it working, upload your project somewhere including IDEA project files so that we can point to your mistake.
Look at the image, notice that the txt files are in the project root, and not the source folders (in blue).
If you open the Project Structure dialog, and click on Modules and select your module - are the correct folders marked as Source Folders on the sources tab?
Link for how to get to Project Structure dialog
Also, if you print out the absolute path of that file you are trying to read, is that anywhere near where you expect it to be?
An easy way to figure out the same would be to try creating a file in the same fashion and see where it gets created in your project. You can put your input file at the same location and it should work just fine (if it doesn't, you should check your resource pattern which might be causing the file to be not copied over in the build output).
This method actually gives you the working directory of your intellij settings which is pointed out in the accepted answer. Just sharing as I had similar trouble and I figured out this way. :)