Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Adding a Preferences Window to Your Application
Subject:   Uncaught Exceptions! Help!
Date:   2001-09-22 21:17:50
From:   kperry8
OK, I've compared my code to the your downloaded example, and its nearly identical from what I can tell, except for minor style differences. However, I always get the following errors when I try and run the app:


AddressBook[1384] An uncaught exception was raised
AddressBook[1384] *** -[NSCFArray addObject:]: attempt to insert nil
AddressBook[1384] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSCFArray addObject:]: attempt to insert nil


AddressBook.app has exited with status 255.


I used the debugger and this is where the exception occurs:


(This is part of the -initializeTableWithColumns method)


// add columns from the argument array
e = [identifiers objectEnumerator];
while ((identifier = [e nextObject])) {
column = [tableColumns objectForKey:identifier];
[tableView addTableColumn:column]; <--ERROR HERE
[[checkBoxes objectForKey:identifier] setState:NSOnState];
}


Can someone help me? Thanks!

Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • Uncaught Exceptions! Help! bug feedback
    2001-09-26 14:05:52  psheldon [View]

    There is this NS alert procedure written in the apple speech synthesis example, I believe. It is supposed to give information when something there goes wrong. You could easily modify it for your code to see if what Mike Beam suggests is correct .
    The senior programmer with the joke taught me about such an IDebug procedure I could make on another programming platform, Data Generals AOS, long ago .
  • Michael Beam photo Uncaught Exceptions! Help!
    2001-09-25 20:04:51  Michael Beam | O'Reilly Author [View]

    right off the bat it looks as though the error actually lies in the tableColumns dictionary. That is, for some identifier there is not a key for it in tableColumns and nil is returned by

    [tableColumns objectForKey:identifier]

    You might want to double check that all of you identifiers and table column names, etc are all the same. If you're still having problems post back and i'll scratch my head some more...

    Mike
  • Uncaught Exceptions! Help!
    2001-09-25 13:43:52  psheldon [View]

    I started drafting a reply that wasn't much help.
    Maybe my writing will get better and more inspirational if I look at it for several days. I don't know .
    I had a senior programmer who once said "you whine and complain when your compiler gives you little information in your syntax errors, wait until you have problems like mine" . She then grimaced and said what her problems were , execution errors involving fundamental theory and being so good that she was constantly assigned to debug other people's programs and downgrade languages to make things readable for them .
    This wasn't an answer to my ambitions, but if I tried real hard I realized that she was making a joke to make things a bit easier to take .
    ;-)