XIB actualization problem - iphone

I'm facing a weird problem dealing with Xcode. When I run my project using simulator I got the correct xib showing, but when I select my iPhone as target, it shows an older version of that xib... I'm going crazy with this, I have tried to clean targets, deleting and reinstalling the app on iphone, :^S
Please could anybody help me with this issue?
Thanks a lot and sorry for my english.

When Xcode installs development builds of iOS apps on the simulator and on the device, it copies all files from the .app bundle into the target directory for the app in the simulator or on the device. However, it does not remove old files. This can sometimes cause strange effects.
For example:
You have MyView~ipad.xib and MyView.xib for iPhone, you install the app and run it on the device, now you decide to delete the MyView~ipad.xib so that it will just use the MyView.xib same as iPhone, you test this in the simulator and it works fine but when you put it on the device again it still uses the old iPad xib file, but how when it's not even in the project any more? Well the old file still exists in the filesystem on the device until you actually delete the app off the device.
This can happen when you remove files from the project or rename them to something else, the old files will still be there and especially if you have fall-back beaviour or how iOS can look for other suffixes automatically like #2x or ~ipad - this can easily cause confusion. Check for this whenever you notice strange effects like old versions of files seem to resurrect themselves, or it works on one device but not the other.

Related

Re-generate device support symbols in Xcode

I've accidentally deleted the different folders in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport, as a result, Xcode is giving me a lot of trouble.
How do I re-generate these folders?
As far as I know it should be something that Xcode generates automatically when you plug in your iPhone, but it doesn't. Any suggestions on what I can do?
How abou just redownloading Xcode? usually Xcode doesn't change stuff within the app.

Iphone app not showing properly on the device

i have an app which works perfectly on the simulator but on the device in is not as expected.
Animations are misplaced and other bugs. But on the simulator it works fine.
My question is how to fix this bug.
Here is list of things I already tried:
Restart Mac.
Restart Xcode.
Clean Project.
Rename Project.
Delete app from iPhone.
Restart iPhone.
Shut down iPhone.
Clean and build in Xcode.
I really don't know where is the problem.
Thank you for your help.
Would be really appreciated.
Notice: App is correctly signed.
Make sure your files typed correctly and are case sensitive. The Simulator is not case sensitive but the iPhone is.
Did you ever move code/xib files into different groups or directories? Sometimes there is a old copy of the file in the original directory after the move. I've had scenarios in which those old files caused the old code to executed when switching between build settings.
If there are duplicate files, make sure you delete those copies at the old location, or those that you don't intend to be used. For instance, if your original directory as ~/Work/App/Resources and the new directory is ~/Work/App/Resources/xibs then delete the duplicated files from ~/Work/App/Resources
Make sense?
Now, after deletions, if files start to show up as red in XCode, that means XCode cannot find them anymore (maybe you deleted one too many, or who knows the state of your workspace). If this happens, use the "File Inspector" to confirm that the location and path XCode is using for the file is correct.

iPhone Dev, 3G Testing Device Launch Failures After App Rename and Upgrade to XCode 4

I have an iPhone app in the app store that I wanted to rename and make universal. I have done all the work for the rename (renamed the PRODUCT_NAME, not the binary identifier) and adding iPad support. Everything was running great on my iPad 2 (4.3.3) and my iPhone 4G (4.3.3). Before I packaged it up, I ran a test on my iPhone 3G (3.0).
I cannot get my app to launch properly on the 3G. When the app launches, the launch screen is displayed as it should be. The screen then goes to black with the status bar on the very top, like it has loaded a black nib or something. There are no error codes whatsoever -- nothing in the console, nothing in a pop up. The application does not even reach the "applicationDidFinishLaunchingWithOptions" method of my appDelegate. The application doesn't crash, either. It just sits there like it's waiting on input from a user, but like I said the application hasn't even finished launching.
The only things that have changed since the last time I tested on the old 3G (which was the last time I updated my app) are the application rename and the upgrade to XCode 4 w/base SDK 4.3.
In my XCode Scheme drop down, it does say: iPhone (3.0, Overriding Base SDK to 4.3). I don't know if that is inadvertently causing this hangup? I am running Xcode 4 with base SDK 4.3. The target deployment is 3.0.
Has anyone encountered anything like this? I would appreciate all insight and advice to the situation. So far I have deleted the application from my device, clean/build Xcode, delete Xcode build folder, delete and reinstall all provisioning profiles, reboot of device and XCode numerous times.
Thanks,
Brandie
As far as I have been able to determine the BEST solution (not the easiest) is to make a new project with the new project name and copy your files. Changing the PRODUCT_NAME gave me wierd results and I said "forget it, let's do it by the book".
If there is an easier solution, I have yet to find it and, frankly, given it takes me about 30 minutes (I've changed the name of an app 4 times - mostly because of name length), it causes me the least amount of grief.

Why isn't my iPhone app bundle replacing the old one during an update?

I'm starting with an app that has foo.png as a resource, and the app is installed (either in the simulator or on the device). If I delete foo.png, do a clean build, etc., and install, then it still shows up in the bundle on the simulator or device!
But I know the file isn't in the bundle before copying to the simulator or device (for example:
I can see it's not there in the build folder.
If I delete the app from the simulator or device, and then install, then foo.png doesn't show up on the simulator or device.
So it seems that when updating, it doesn't replace the app bundle; instead, it only copies new files and replaces updated ones. (I can confirm that it does, in fact, copy and replace files properly.)
Why isn't it replacing the entire app bundle?
If you update your application through iTunes using an ad hoc build you will see that your .app bundle will be replaced completely and old resources, such as the foo.png file described in the original post will be removed.
Reset the simulator, go up to the menu and then click reset simulator. I always have that problem with databases on the device. You will have to delete it on the device. Just a quirk that I've experienced as well.

How to force application Settings bundle get updated?

Application Settings.bundle contains a version number, which is automatically generated during build. From build log I can see that new value is written there, also when looking inside the file itself in MacOS X Finder I see correct updated value.
Settings in iPhone simulator or in real iPhone shows me the old value. Removing application and reinstalling is so far the only way I've managed to get the new updated value visible.
Question: how can I force iPhone Settings application to read my new latest updated bundle file?
Some background info, which might or might not be related: I install application only via Xcode into both simulator and iPhone. Is this the problem? Just found this in Apple docs, not sure what it actually says. Seems to contradict itself (last chapter)...
Each time you reinstall your application, iPhone OS performs a clean install, which deletes any previous preferences. In other words, building or running your application from Xcode always installs a new version, replacing any old contents. To test preference changes between successive executions, you must run your application directly from the simulator interface and not from Xcode.
So Xcode always replaces old content, but to test changes I cannot use Xcode? What was that? Done both (after installation via Xcode) and didn't see new values in settings. Any ideas how does it actually work? Do I always have to make non-Xcode installation?
Try cleaning and building. It seems that xcode caches dates and doesn't notice the change that your script is making. I've had similar things happen, clean always fixes it, but it is indeed a nuisance.
Make sure to shut down the Settings app running in the background on device. It looks like Settings caches settings while it's running - but pulls the updated values when the Settings app is re-launched.
In my case, it seems that my modified root.plist, created/edited via the Xcode property list editor, just wasn't being saved.
There was no problem at all with the Settings Bundle being copied over to the iPad. A quick cmd-S followed by a rebuild and go/debug updated Settings on the iPad straight away - no app uninstall/reinstall even needed. You'd think there'd at least be a haven't-saved-it warning from Xcode, as there always is for code source files.
I just tried this and it worked.
In Xcode go to : Window->Organizer,
then view installed apps on the connected iPad/iPhone, remove the app, then recompile and run your app on the device.
I think the issue has something to do with the iPad's cache.