Xcode 4 won't update xib Interface on Simulator - ios

I'm using Xcode 4.0.2 and im having this major issue. I can do what i want with my xib, delete all the views, move any objects around, or even delete the whole xib, but if i build & run my app on simulator it doesn't update the interface. It looks always the same, like it looked yesterday, but although i changed all the views it never updates the interface of the .app running on simulator. I have closed xcode a million times, deleted the app from simulator a million times, it's still the same |: Any ideas?

Try cleaning the product before rebuilding, and check that the xib is included in your target.
Alternatively, your project isn't using that .xib file at all and you've been editing the wrong one, or you decided at some point to build the interface in code instead and have since forgotten about it!

Try to delete it from Simulator manually: /Users/yourUsername/Library/Application Support/iPhone Simulator/4.3/Applications/

Related

Xcode 6.3 storyboard stuck

When I open storyboard, the XCode shows that it's building right now, I suppose because of IBDesignable I use.
So it never got success, XCode stuck:
I tried to open just storyboard file with opening entire project, so seems it works, but when I try to close it, it's starting stucking again, I can't close it, and it every time in my process.
I tried restarting my mac, deleting xcuserdata, but nothing help to me.
It's upset because I written entire project using storyboards and now I can't continue to work on the project =(
One more when I try to open another file and I am in storyboard right now, like selecting a class or project file it also stuck. (switching from storyboard)

Xcode 6.3 Crashes when navigating from storyboard to other Swift 1.2 file

I installed Xcode 6.3 which includes support for Swift 1.2. It turned up a ton of error messages, which are mostly casting issues.
I navigated to the storyboard, and cannot go back to any other .swift without the whole thing crashing. I have force quit, restarted, and even re-installed, and I still can't navigate away from the Main.storyboard file.
I have tried the suggestion described here to open storyboard as code, make some changes, revert those changes, save and try again, and still no luck.
Is something in my code breaking Xcode? Is anyone else experiencing this? I had used Xcode 6.3 beta successfully with the same codebase.
Update:
This has now been fixed in Xcode 6.3.1 released on the 21st of April 2015.
I gather from the apple developer forums that this is an #IBDesignable issue. Especially in projects that use custom fonts, additional xibs, etc.
I have somehow fixed my issue by removing all #IBDesignable from swift UIView class definitions. You can open your project directory with TextMate or other, search and remove all "#IBDesignable"
However I still think this is a MAJOR bug, that needs to be worked on.. so keep filing bug reports to Apple.
A temporary solution:
By opening a "New Window" (same project).
One for the code, one for the storyboard or reduce first, work freely with second window.
You can keep your #IBDesignables
EDIT : Bug fixed -> Update Xcode 6.3.1
Launching Xcode while holding shift fixed it for me.
(This suppresses Xcode's state restoration.)
Update: Xcode 6.3.1, released today, resolves this issue.
Update
Xcode 6.3.1
For me, everything works !
Temporary solution:
If you have currently opened Assistant Editor switch to another file using alt+click. You can keep your #IBDesignables.
Here's how I get around this strange bug:
Before launching Xcode, rename the storyboard file in finder so that Xcode won't find it (e.g. add the extension .temp)
Launch Xcode - works fine even if it hanged before since it cannot display the storyboard editor
Open a new window in Xcode
Rename the storyboard file to its original name
In the new window in Xcode - select the storyboard - Xcode does not hang
Minimize the new window and work as usual in the original window. Now you can select any file - even the storyboard - without Xcode hanging
One problem remains, though, at least for me. Every time I select a file or edit something, Xcode needs to recompile the storyboard. Haven't solved that one yet.
I can confirm this bug. I was stuck in storyboard and could do nothing to get out of it (couldn't even open the assistant). As a workaround, with the storyboard open, right-click the .storyboard file and select Open As - Source Code. This will switch your storyboard to code and you will be able to then switch to any file.
It is not a bug anymore since Apple fixed it in Xcode 6.3.1.

Can't open storyboard or xib files in xCode 6 or more

Every time I try to open storyboards and xib files in new xCode 6 or 6.1 and on Yosemite. This happens while my colleague can open it in xCode 6 on Maverick. I repeatedly get following error:
The document "MainStoryboard.storyboard" could not be opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder error -1.)
I still can open it on xCode 5 on Yosemite. I also tried this method:
Open xib file in an text editor and remove all ImageViews' property of ImageName which has .png format; It helped to open some of it but not All of them!
It is a very bad situation and I am stuck!
This information are provided by console:
Exception raised while unarchiving document objects - -[NSTaggedPointerString getCharacters:range:]: Range {0, 10} out of bounds; string length 4
What is the problem and how can I solve it?
Well the problem was with name of some images I used in UIImageViews.
I opened xib files in a text editor and find all of these patterns "X/Y.png".
And I replaced it with "Y.png".
That solved my problem!
Back the project up before you do this but:
Drop to terminal
Confirm that Developer Tools are set up correctly by typing xcode-select -p
(it should be /Applications/Xcode.app/Contents/Developer)
If it isn't then, it should be pointing to wherever your Xcode lives i.e. /Applications/MyDeveloperTools/Xcode.app/Contacts/Developer
You can change it by running:
xcode-select -s /path/to/the/folder/where/xcode/is/Xcode.app/Contents/Developer
If that's all fine then.
Drop to terminal (or stay there if you're still there
Navigate to your project folder (where the Xibs are) n.b. its important that the above steps are right too!
run ibtool --upgrade myNonWorkingXibOnXode6.xib
From here on in, that Xib should work fine.
Another note is that "compiled nibs won't work via that any more"
Had some similar error when opening a storyboard in Xcode 6 for the first time.
One solution, for me was to open the storyboard with your text editor of choice and manually set auto layout to false: useAutolayout="NO". Problem with this approach is that you'll loose all of your layout constraints.
Another option that worked even better for me, was to install/use Xcode 5.1, open the storyboard and, in File Inspector in section Interface Builder Document, update Opens in option to use Default (5.1), then open the storyboard again in Xcode 6.

Changes in xib not shown at runtime

I have seen simialr posts on this issue, but none of the answers have worked for me.
When I make changes to xibs in Interface Builder, they do not show at runtime. So far I have tried the following:
Clean
Clean Build Folder
Reset Content on Simulator
Restarted XCode
Restarted the simulator
I've tried all of these steps in about every conceivable order, but still no changes in IB can be seen when I run the app. Earlier today, my changes were showing, so I do know that the xibs are definitely loading. I believe something has gotten hosed in XCode, perhaps? Any suggestions?

Not able to see localized images in iPhone simulator

I have an existing working iPhone project inside XCode 4.2. I localized an image (which is used on a button) and I always see the old version of it inside the iPhone simulator. Where does it find that old version?
What I've done:
Window -> Organizer -> Project -> Delete Derived Data
Product -> Clean
Inside the IPhone simulator, I tried resetting it.
I tried deleting the project and recreating it (from SVN)
I deleted everything in Library->Developer->Xcode, Library->Delveoper->Application Support->iPhone simulator, Library->Developer->Application->Interface Builder 3.0
And I still see the old version... Is it compiled somewhere inside the interface builder with the button or something like that? Weird... really weird.
Note: I'm able to localize an image button if I add a new image, but using old existing image is always showing me the old version.
Solution :
My project contained images like ImageName#2x.png (for IPad I guess).
By also localizing those + clean + build + reset IPhone Sim settings, it worked. Go figure.
Also, when I add another language for the #2x images, I have to manually add the image in the other xx.lproj (where XX is the language code) with the finder because somehow XCode doesn't it.
Delete the App in iPhone Simulator (same way you would delete it on real iPhone) and try it again.
I have encountered a similar problem to this where the XIB file would not accept modifications. I eventually fixed by renaming the XIB file and then changes were accepted. Worth a try in your case I think.

Resources