1

I have an XCode project that compiles and runs fine but when I add an element to the UI of a particular XIB it crashes XCode when I try to save or when XCode loses focus. Looking at the error data of the crash it seems to be an Assertion Failure relating to an NSTableHeader but I don't understand where to go from there? I am not using auto-layout and this is an OSX app.

Process:               Xcode [2505]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               7.3.1 (10188.1)
Build Info:            IDEFrameworks-10188001000000000~3
App Item ID:           497799835
App External ID:       817226719
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [2505]
User ID:               501

Date/Time:             2016-06-14 11:30:04.824 -0700
OS Version:            Mac OS X 10.11.5 (15F34)
Report Version:        11
Anonymous UUID:        20048F22-546D-D351-6F8C-D73FF28F4650


Time Awake Since Boot: 67000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 7D1014
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-10117/InterfaceBuilderKit/Document/ObjectContainer/IBObjectContainer.m:513
Details:  Can't get the OID of an object not in the document: <NSTableHeaderView: 0x7fc5daeefd90>
Object:   <IBObjectContainer: 0x7fc5dae4eeb0>
Method:   -objectIDForObject:
Thread:   <NSThread: 0x7fc5d3e17e80>{number = 1, name = main}
Hints:   None
Backtrace:
  0   -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   -[IBObjectContainer objectIDForObject:] (in IDEInterfaceBuilderKit)
  4   -[IBDocument objectIDForObject:] (in IDEInterfaceBuilderKit)
  5   -[IBDocument documentArchiver:referenceIDForObject:referenceType:] (in IDEInterfaceBuilderKit)
  6   -[IBDocumentArchiver referenceIDForObject:withReferenceType:] (in IDEInterfaceBuilderKit)
  7   -[IBDocumentArchiver archiveObjectReference:referenceType:forKey:] (in IDEInterfaceBuilderKit)
  8   -[IBDocumentArchiver archiveObjectReference:referenceType:forKey:defaultValue:] (in IDEInterfaceBuilderKit)
  9   -[NSTableView(IBDocumentArchivingGenerator) archiveWithDocumentArchiver:] (in IDEInterfaceBuilderCocoaIntegration)
 10   __51-[IBDocumentArchiver archiveObject:forOptionalKey:]_block_invoke (in IDEInterfaceBuilderKit)
 11   -[IBDocumentArchiver recurseWithElementNamed:forObject:kind:invokingBlock:] (in IDEInterfaceBuilderKit)
 12   -[IBDocumentArchiver archiveObject:forOptionalKey:] (in IDEInterfaceBuilderKit)
 13   __59-[IBDocumentArchiver archiveArray:withName:forOptionalKey:]_block_invoke (in IDEInterfaceBuilderKit)
 14   -[IBDocumentArchiver recurseWithElementNamed:forObject:kind:invokingBlock:] (in IDEInterfaceBuilderKit)
 15   -[IBDocumentArchiver archiveArray:withName:forOptionalKey:] (in IDEInterfaceBuilderKit)
 16   -[IBDocumentArchiver archiveArray:withName:forOptionalKey:defaultValue:] (in IDEInterfaceBuilderKit)
 17   -[NSView(IBViewIntegration) ibArchiveSubviews:] (in IDEInterfaceBuilderKit)
 18   -[NSView(IBDocumentArchivingGenerator) archiveWithDocumentArchiver:] (in IDEInterfaceBuilderKit)
 19   -[IBNSCustomView(IBDocumentArchivingGenerator) archiveWithDocumentArchiver:] (in IDEInterfaceBuilderCocoaIntegration)
 20   __51-[IBDocumentArchiver archiveObject:forOptionalKey:]_block_invoke (in IDEInterfaceBuilderKit)
 21   -[IBDocumentArchiver recurseWithElementNamed:forObject:kind:invokingBlock:] (in IDEInterfaceBuilderKit)
 22   -[IBDocumentArchiver archiveObject:forOptionalKey:] (in IDEInterfaceBuilderKit)
 23   __59-[IBDocumentArchiver archiveArray:withName:forOptionalKey:]_block_invoke (in IDEInterfaceBuilderKit)
 24   -[IBDocumentArchiver recurseWithElementNamed:forObject:kind:invokingBlock:] (in IDEInterfaceBuilderKit)
 25   -[IBDocumentArchiver archiveArray:withName:forOptionalKey:] (in IDEInterfaceBuilderKit)
 26   -[IBDocument archiveTopLevelObjects:] (in IDEInterfaceBuilderKit)
 27   -[IBDocument archiveAndVerifyArchivingOfTopLevelObjects:] (in IDEInterfaceBuilderKit)
 28   -[IBDocument archivePlatformIndependentDataWithDocumentArchiver:] (in IDEInterfaceBuilderKit)
 29   -[IBDocument archiveDocument:] (in IDEInterfaceBuilderKit)
 30   -[IBDocumentArchiver recurseWithElementNamed:forObject:kind:invokingBlock:] (in IDEInterfaceBuilderKit)
 31   -[IBDocumentArchiver archiveDocument:withType:compatibilityVersion:] (in IDEInterfaceBuilderKit)
 32   -[IBDocumentArchiver dataFromArchiveDocument:withType:compatibilityVersion:] (in IDEInterfaceBuilderKit)
 33   __46-[IBDocument fileWrapperOfType:options:error:]_block_invoke (in IDEInterfaceBuilderKit)
 34   -[IBDocument fileWrapperOfType:options:error:] (in IDEInterfaceBuilderKit)
 35   -[IBDocument fileWrapperOfType:error:] (in IDEInterfaceBuilderKit)
 36   -[NSDocument writeToURL:ofType:error:] (in AppKit)
 37   -[IBDocument writeToURL:ofType:error:] (in IDEInterfaceBuilderKit)
 38   -[NSDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] (in AppKit)
 39   -[IBDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] (in IDEInterfaceBuilderKit)
 40   -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:forceTemporaryDirectory:error:] (in AppKit)
 41   -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:error:] (in AppKit)
 42   -[NSDocument writeSafelyToURL:ofType:forSaveOperation:error:] (in AppKit)
 43   -[IDEEditorDocument writeSafelyToURL:ofType:forSaveOperation:error:] (in IDEKit)
 44   __66-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_22463 (in AppKit)
 45   __66-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke2460 (in AppKit)
 46   __66-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_22313 (in AppKit)
 47   __50-[IDEEditorDocument continueFileAccessUsingBlock:]_block_invoke.74 (in IDEKit)
 48   -[NSDocument continueFileAccessUsingBlock:] (in AppKit)
 49   -[IDEEditorDocument continueFileAccessUsingBlock:] (in IDEKit)
 50   __101-[NSDocument _fileCoordinator:asynchronouslyCoordinateReadingContentsAndWritingItemAtURL:byAccessor:]_block_invoke_2 (in AppKit)
 51   __68-[IDEEditorDocument continueAsynchronousWorkOnMainThreadUsingBlock:]_block_invoke (in IDEKit)
 52   __62-[NSDocumentController(NSInternal) _onMainThreadInvokeWorker:]_block_invoke2079 (in AppKit)
 53   __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ (in CoreFoundation)
 54   __CFRunLoopDoBlocks (in CoreFoundation)
 55   __CFRunLoopRun (in CoreFoundation)
 56   CFRunLoopRunSpecific (in CoreFoundation)
 57   RunCurrentEventLoopInMode (in HIToolbox)
 58   ReceiveNextEventCommon (in HIToolbox)
 59   _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
 60   _DPSNextEvent (in AppKit)
 61   -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
 62   -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
 63   -[NSApplication run] (in AppKit)
 64   NSApplicationMain (in AppKit)
 65  0x000000010c51a39b (in Xcode)
 66   start (in libdyld.dylib)

abort() called
ThinkCL
  • 119
  • 3
  • 12

1 Answers1

1

I am having a similar problem, and I think it is because my XIB files are quite old (from XCode 4.6 or older). There was a major change in the xml-schema since then. (See this article.) I was able to make the change to my XIB I needed to make by fishing XCode 6 out of Time Machine and copying alongside XCode 7 in Applications. I have not attempted to open any projects with XCode 6, but I opened the XIB directly and made the change I needed to make outside the project.

What's weird is that I was able to modify one of these XIB files only a couple of weeks ago. XCode (7) then completely rewrote the XML with the new schema, and it now has no problem editing that XIB. Also, even XCode 6 crashes now if I try to upgrade an XIB to a newer schema. (I guess I can only edit my XIB because XCode 6, unlike XCode 7, can still edit the old schema without upgrading it.)

I think Apple may have introduced a software update in the last couple of weeks that is external to XCode but nevertheless broke the xml upgrade. Or else something else I've done did it, but I can't think what it could be.

FWIW: I'm on 10.11.5, so at least the Interface Builder part of XCode 6 still works on the latest OS.

EDIT: I was able to upgrade the XML and thus be able to edit XIB in XCode 7.3.1 using a slightly more involved solution:

  1. Use Fusion or Parallels to create a 10.8 virtual.
  2. Install XCode 5.1.1 in the virtual. (You can find download links here.)
  3. Open the XIB in XCode 5.1.1 and upgrade it. You will now be able to open it and save it in XCode 7.
Community
  • 1
  • 1
rpatters1
  • 382
  • 1
  • 11
  • Thanks, your answer makes sense. My project is several years old and I suspect you're correct about the XML schema changes. Luckily I was able to track my problem down to a NSTableView that I was able to delete and everything seems happy now. – ThinkCL Jun 27 '16 at 15:58