Are images copied to Xcode project - iphone

Ive had some svn woes with an Xcode project and now using an older version from another user (we've taken it out of svn now).
Trouble is it looks like images have been lost on the way. Or more correctly, they load in the app when testing locally, but when I Archive the app and add to Testflight the images arent complied with the .ipa
There are alot of images and its really hard to tell what has been copied to the project and what is being taken locally. Is there a method of finding out how to do this more easily than deleting the image out of the app's file system, then from inside xcode then re-adding them from a local copy?

Answer was to go into the Build Rules, delete all the image from the Copy Bundle Resources section and re add them to the project - fun!

Go to SCM from Left hand side project explorer.
Expand SCM -> you will find images in red color which are in SCM but not on your local.
You have to right click-> Update it
Then open you project in Finder and find your image and just create relative path in your project.
Hope it helps....

Related

How do I import existing iPhone app without .xcodeproj file into Xcode

I have an existing iPhone app (made on a previous version of XCode by a colleague) that I would like to import into XCode. I have the files FirstViewController.h, .m, and .xib files as well as the ones for the other views that were all renamed. I also have the supporting files, such as the sqlite database that is being used, images, the AppDelegate files, and so on. However, I was given all of these files without the .xcodeproj file. I have been trying to recreate the app given all of these files, but to no luck. Can anyone please give me any hints or direction as to how I should try and recreate this app?
If you absolutely cannot get ahold of the original Xcode project file, I would recommend just going through the standard New Project wizard to create a new project, and then import your existing files into the new project. This would involve, at a minimum:
Launch Xcode (the latest available version)
Create a new project by choosing File menu > New > Project
Choose an iOS application project template which most closely resembles your application
Follow the rest of the wizard steps to create your project
Once you have your new project, import the existing files:
For each type of file, right click in one of the file groups in the Project Navigator in the left-hand sidebar and select 'Add Files to …', then follow the prompts to import your file(s)
Adjust your code to build properly, using Product > Build and Product > Run as needed.
The iOS App Programming Guide can likely answer a lot of general questions about how to lay out your app structure, set up build settings, etc. Code signing and Deployment Target are two important project-specific settings you'll need to configure, which can be done using the project settings editor by selecting the very top row (where it says your project's name) in the Project Navigator. That should hopefully get you started.

Deleted a file manually: How can I fix Xcode project file?

I'm developing an iOS 4 with latest iOS SDK and XCode 4.2.
I don't know how, but I have found that one of my ViewController.xib has been moved to en.lproj folder.
I've moved this file out of this folder, and added it again to project.
But now, when I compile I get a waring saying that I en.lproj/ViewController.xib is missing from working copy.
How can I fix this?
you may be having a soft link of en.lproj/ViewController.xib in project group . It will be red in color after building . You just delete them from the group.
Select your ViewController.xib file in Xcode's list of files & groups along the left side of your project window and then open up file inspector and that's where you can change the path.
Here is how I do it:
I hope this helps you out!
This is not a direct answer to your question, but I'd still say this.
Use something like git or svn to avoid such mistakes. The new XCode in fact gives an option for git while creating a new project.
If you are already using Code Revision Control System, just look for the commit that did this change and revert it. (I am using git language here)

Organise my project folder

It's a terrible mess in my project folder (not in xcode, where all is clean, but on the desktop folder).
How can I organize this folder without killing all xcode references ? I just tried, but all the links broke.
Thanks,
What I'm used to do in this case is:
Organize everything in my finder folders, don't mind the red missing files in xcode. If you are using svn, make sure you use its commands to do this.
Then I go to each file in XCode marked red and redefine its Location using the right pane Utilities tab (xcode 4) or its file properties(cmd+i in xcode 3).
Clean and build to make sure everything is OK.
To avoid this, I got used to organize my project each time I create a new file/folder. I first create the folder physically and then add it to xcode, later I create the files.
I don't know a simpler way of doing this.
Hope it helps,
I've been there myself :) You do need to remove and add back in the files that need organizing , but it can be safely done. Here's what I'd normally do;
Remove the files / folders you need to organize from within your XCode project (this is safe, you can add them back, no worries) ONLY DELETE THE REFERENCES when asked. Do NOT Trash them.
Close XCode
In your desktop folder, now arrange and organize your files and folders as needed.
Open up your XCode again, and open your project. Now, re-add your now well-organized files and folders back into the XCode project. Copy them into to your folder if you happen to be adding anything from outside the desktop folder.
Now, your project will be well organized both in and outside.

Restore Project Settings in XCode

How can I restore Xcode project settings? I can't see few settings (like Targeted Device Family, iPhone OS Deployment Target, etc.) after I gave my Macbook to my friend. :(
I also saw that the info.plist file was not in the project, I recovered it via TimeMachine though, the Base SDK is also missing. :( She messed all things up, I don't know why she went in there. Anyways, is there any way to restore the settings?
Unfortunately, the snapshot that I have is also very old. :(
No way to restore them. You can set the base sdk on the project info screen.
Project > Edit Project Settings > Base SDK, Check the same for your Target.
Is this issue occurring for a specific project, or all projects? If you create a new project, what happens?
I forget the exact syntax, but different versions of XCode handle project files slightly differently. A new SDK (and version of XCode) couldn't read my project file right (same symptoms you explain).
In my case, there were 2 different SDK settings in the project file due to 2 separate versions of XCode editing the file (this could be very likely if you restored from backup and had upgraded SDKs in the interim).
Look for something like:
SDKROOT = iphoneos4.2;
Or really, just look around the text that contains the build settings (all of your build settings are stored in the file in flat text) -- you may see something related to SDKs where there are 2 lines very similar right next to each other. That'd probably be your problem. If you don't know which to delete, try both and then re-set the setting using the interface.
Of course in any case, you should back up your project file (project.pbxproj) before trying any of this.

How can I tell xCode to recheck project resources that have been modified?

I'm working with a designer friend on an iPhone app and he likes to refine all sorts of images relating to the project we're working on. All these images have been added to the project previously (and added to the project folder by xcode) and then are modified in their new location. When I preview the images in xCode, the updated images show up but building and running in the simulator or on a device doesn't pick up the new image. In fact, if I do a clean build it seems to ignore the image all together and blank spaces appear where images should be.
Now, I can delete these files from the project and re-add them and everything works peachy again. But there are a lot of them and I'd rather not do that every time an image is updated. Is there a way to get xCode to review and "learn" about these modified images? Is there a good reason for why it's not doing that automatically?
You didn't specify how you're including those image resources into your project, but I'd guess you're including them directly. So unless there's an underlying process that's changing the file in-place (are you using an SCM like Subversion or Perforce?) you're going to be forced to manually overwrite the files whenever your artist friend updates them.
You should include art assets in the project using a folder reference instead. (I'm still assuming you have some sort of SCM set up to handle exchanging data -- if you don't, set one up ASAP.) However, there are still some outstanding Xcode bugs related to picking up changes to files in a nested folder hierarchy included by reference, but at least you can work around that by doing clean builds when necessary.