tags:

views:

485

answers:

2

I just started getting this error today, seemingly out of nowhere. Any one see this before and know what causes it.

Internal error occurred while creating dependency graph: *** -[NSCFArray initWithObjects:count:]: attempt to insert nil object at objects[10]

This happens when I try to build with "iPhone Device 3.x" selected. However, if I select "iPhone Simulator 3.x", everything is fine.

I am using Xcode 3.2.1.

A: 

You have an NSArray or NSMutableArray into which you are trying to insert a nil or uninitialized object. As the documentation for these two arrays indicates, this is not allowed.

You need to troubleshoot where you are inserting values into an array (presumably objects) and find out where that nil value is coming from.

Alex Reynolds
+1  A: 

I found the solution to my problem and it was quite simple.

  1. Quit Xcode
  2. Reopen Xcode
  3. Open your project
  4. Clean All Targets

Now everything works fine although I wish I knew how I got into that state.

Randy Simon
What it looks like is that there is stale build information data that Xcode is trying to load before it runs the dependency graph to figure out whether it needs to be updated. This can happen across Xcode beta releases; deleting your build folder when moving from one version of Xcode to another is sometimes helpful, usually when you've been installing new SDKs.
cdespinosa
This makes sense and I did upgrade to XCode 3.2.1 recently but I am pretty sure that this was not the first time I attempted to build for the device since the upgrade.
Randy Simon