4

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.
0

3 Answers 3

6

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.

5
  • 4
    Saved me quite a bit of time loading up a 7.1 project to 8.0. To follow up: remove all image=".." references in storyboard. Then it will load and compile. Yaroslav keep posting :) Sep 23, 2014 at 1:46
  • +1 for the suggestion of opening the storyboard (in a text editor, in my case) and removing the image references. That was exactly what I needed to do. Sep 26, 2014 at 23:20
  • I noticed that the images causing the issue had a resource path like "icons/arrow.png" (the assets were organized into folders and I was using folder references in the project). Apparently in Xcode 6, the full path is no longer needed, and in fact breaks everything, so simply changing the above to "arrow.png" worked.
    – Sam V.
    Oct 23, 2014 at 21:15
  • @SamV. you are indeed correct. The question now begs to be answered, how do we deal with images named the same on different folders? Oct 23, 2014 at 22:18
  • @Yaroslav thanks to your question and answer, you save me lots of time! Keep asking! Oct 23, 2014 at 22:19
1

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.

0

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.