0

Disclaimer: I'm quite new to the language, so I apologize if I've done something illogical or explain something incorrectly. I'm also new to StackOverflow...

So far, in Xcode (Objective-C), I've started an empty project and added a View Controller object with a Collection View object inside of it that contains a single Collection View Cell. That cell has Image View & Label objects (one of each). I've added a Storyboard and ViewController.h + ViewController.m pair of files (subclass of UIViewController).

Initially I started with an empty project template, but ran into problems and deleted the project folder and started over with a single-view template.

Now, whenever I use any CollectionView object in any project, I get an error from Xcode upon running it. It appears in Thread 1, the "main" section of the Debug Navigator:

"Terminating app due to uncaught exception 'NSUnknownKeyException', 
reason: '[<ViewController 0x7419bb0> setValue:forUndefinedKey:]: this
class is not key value coding-compliant for the key breadboxCollectionView.'"

I did use "breadboxCollectionView" as an outlet property name for a CollectionView object, tied to my ViewController header. I did that in one of my prior projects though.

If I add a second Collection View object, and tie it to the View Controller header file, as an outlet to a property named "breadboxCollectionView" then the application launches without throwing any exceptions. It doesn't display the second collection view object, but I'm going to consider that an entirely different hurdle at this point. I need the reference to "breadboxCollectionView" to vanish.

I tried to delete the second Collection View object, but after running the application afterward: boom, same error shows up.

I tried to delete the second Collection View object by doing these things in this order: 1) delete outlet connection 2) delete the property entry in the view controller header file 3) delete the second collection view object.

I've removed and reinstalled Xcode. I've removed all traces of prior projects. I've started a new project from scratch... again. I've also opened my *.storyboard file with a text editor outside of Xcode and searched for any traces of "breadboxCollectionView."

I'm still getting the same error, with the same reference to "breadboxCollectionView" and cannot locate where this variable is listed on my computer to fix it.

I've tried going over other questions here, about NSUnknownKeyException errors, but it seems that each one tends to be rather unique. The Apple Developer documentation is also less than helpful, in my opinion, for this situation.

Does anyone have ANY suggestions?

UPDATE 1:

I just did the following, and actually found a reference to "breadboxCollectionView." Though, it didn't help:

  1. opened xcode.app package contents
  2. finder search for breadbox
  3. only one file appeared
  4. opened with xcode
  5. no sign of the variable in xcode
  6. closed xcode and reopened with textedit.app
  7. cmd+F to search for "breadbox"
  8. a single result displayed within a *.storyboard file; I thought I did this and discovered nothing previously:

    <class className="ViewController" superclassName="UIViewController">
                <source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
                <relationships>
                    <relationship kind="outlet" name="BreadrackCollectionView" candidateClass="UICollectionView"/>
                    <relationship kind="outlet" name="breadboxCollectionView" candidateClass="UICollectionView"/>
                </relationships>
    </class>
    
  9. deleted the entry

  10. saved with textedit.app
  11. closed and reopened with xcode
  12. ran project
  13. simulator throws the same error still.

Is there a way to completely cleanse my computer of 100% of Xcode, and start over? I haven't done a whole lot with this, and it's my only project. I shouldn't be missing anything important. Should I need to do that, even?

  • 2
    Do a control click in interface builder on the object for which you want to delete the connection. Then click on the x. – dasdom Dec 04 '12 at 11:14
  • The only connection that's there, uses a different value for the property name. The entire current project is comprised of completely different filenames and variables, too. I did do what you suggested, but the error persists upon running. Same results. – Wayne Patnode Dec 04 '12 at 11:22
  • And please ***never abuse that poor 'Xcode' tag.*** –  Dec 04 '12 at 14:44

1 Answers1

0

So, I found an answer to this. It came from a non-SO resource though, but the instructions are as follows:

Maybe you should try clearing the cache of Xcode as well as iPhone simulator.

Xcode cache: How to Empty Caches and Clean All Targets Xcode 4

iPhone Simulator With the simulator open from the menu select iOS Simulator -> Reset Content and Settings

This worked for my situation, and quite well actually. I am able to use CollectionView objects in projects now, without the reference to the erroneous property outlet.

Thank you, everyone, for your valuable input and time!

Community
  • 1
  • 1