user1485367
user1485367

Reputation:

Can't open Storyboard with Xcode 6

I have a project with 2 storyboards built in Xcode 5.1. When I open either of those in Xcode 6 I get this error. They never opened in any beta so I don't think it's a bug of Xcode. Last tried in Xcode 6 GM.

The document "Main_iPhone.storyboard" could not be opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder error -1.)

Log says this:

ibtoold[1880:1335652] Exception raised while unarchiving document objects - -[NSTaggedPointerString getCharacters:range:]: Range {0, 10} out of bounds; string length 9
    Recovery Suggestion: Check the console log for additional information.

Upvotes: 4

Views: 4066

Answers (3)

EeKay
EeKay

Reputation: 6770

UPDATE:

As stated over here (Xamarin forum) :

Option 1: Manage all UIImageView.Image properties in code

Rather than setting the Image property of a UIImageView in the storyboard or .xib file, you can set the property in one of the view life cycle override methods in the view controller (for example, in ViewDidLoad()). See also http://developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/ for tips about using UIImage.FromBundle() vs. UIImage.FromFile().

Option 2: Move all of the image resources to the top-level Resources folder

After this change, you will need to update the storyboard and .xib files to use the new top-level image paths.

Option 3: Set the LogicalName for any problematic image assets so they are copied to the top level of the .app bundle

For the example above, the .csproj file will by default contain the following entry:

You can change this element and add a LogicalName so that the image will instead be copied to the top level of the .app bundle:

image.png


Old answer

The guys at the Xamarin forum answered it:

https://forums.xamarin.com/discussion/26272/yosemite-failed-to-compile-interface-file-xamarin-ios-8-2-xcode-6-1

RobertDebault states:

If you have a path statement in your image interface control then it will fail. You need to remove all image path statements and put the images in you resources folder. It sucks and Apple has stated that this is way it should be done from here on out.

Appears that Apple demands devs to store the images in the Resources folder from now on...

Upvotes: 0

joehanna
joehanna

Reputation: 1489

This problem is not exclusively for StoryBoards. I have the same error when opening a regular UIViewController that contains a PNG image.

I edited the XIB in a text editor to remove a PNG image I had on a button. I could then open the XIB in Xcode.

Upvotes: 1

user1485367
user1485367

Reputation:

Made it work when cleared Image property of some UIImageViews with .png format. I'm afraid, at the end of the day, it was a bug in Xcode 6. Hopefully, this question will help someone.

Upvotes: 6

Related Questions