1

I duplicated a target and modified the corresponding property list file. Added a preprocessor macro that helps build the duplicated target from the same source files.

But XCode 4.2 keeps crashing when I try to do a clean build. Interestingly, it works fine on an initial build. But when I clean original target and try to rebuild the duplicated target, XCode crashes.

enter image description here

Stack trace -

ASSERTION FAILURE in /SourceCache/IDEKit/IDEKit-955/Framework/Classes/Editor/IDEEditorDocument.m:635 Details: (lastKnownModificationDate) should not be nil. Object: <IDEQuickLookDocument: 0x4020b7fc0> Method: -_respondToFileChangeOnDiskWithFilePath: Thread: <NSThread: 0x40010a260>{name = (null), num = 1} Hints: None Backtrace: 0 0x0000000107035466 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:messageFormat:arguments:] (in IDEKit) 1 0x00000001066a8794 _DVTAssertionFailureHandler (in DVTFoundation) 2 0x0000000106fb66c7 -[IDEEditorDocument _respondToFileChangeOnDiskWithFilePath:] (in IDEKit) 3 0x00007fff8ca4ca82 _dispatch_call_block_and_release (in libdispatch.dylib) 4 0x00007fff8ca4e8f2 _dispatch_main_queue_callback_4CF (in libdispatch.dylib) 5 0x00007fff8c2fee7c __CFRunLoopRun (in CoreFoundation) 6 0x00007fff8c2fe486 CFRunLoopRunSpecific (in CoreFoundation) 7 0x00007fff8f07e2bf RunCurrentEventLoopInMode (in HIToolbox) 8 0x00007fff8f08556d ReceiveNextEventCommon (in HIToolbox) 9 0x00007fff8f0853fa BlockUntilNextEventMatchingListInMode (in HIToolbox) 10 0x00007fff869e2779 _DPSNextEvent (in AppKit) 11 0x00007fff869e207d -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit) 12 0x00007fff869de9b9 -[NSApplication run] (in AppKit) 13 0x00007fff86c5aeac NSApplicationMain (in AppKit) 14 0x0000000106637eec (in Xcode) 

Has anyone faced the issue before ? Thanks.

1 Answer 1

1

I found the answer. Project file was from Xcode 4.1 but I was using version 4.2 to build it. When I used the version 4.1 to build the project, everything worked fine. Interestingly, there were no warnings when I used an upgraded version to open the project file.

A couple of things to note when duplicating the target -

  1. Change the Product Name in the target Build settings too. Just modifying the target file name directly isn't going to change in in Build settings as well.

  2. If intended to use a different GUI for the new target, use the same name in the correspoinding .plist file.

  3. The new GUI file needs to be included in the bundle.

  4. The preprocessor macro for the compiler flags must be only for the new target.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.