Confusing error messages

Hey all,

This time, I’m not asking for help :stuck_out_tongue: sky turns red

I’m actually here to ask why a particular entry of user defaults will error.


make new default entry at end of default entries with properties {name:"HideCorrupts", contents:HideCorrupt}

This runs normally. However, if I have the name set to “HideCorrupt” (no “S”) then the script errors with [NSCFString count]: selector not recognized.

This is the same for reading and writing to user defaults as well. Is there any reason that it doesn’t like this? Naming conventions, or something?

-Parrot

The only place where I can see that you might have problem with actual names, is when using reserved words in your names. I’m pretty sure that “HideCorrupts” is certainly not a reserved word, so it’s off to look for another culprit.

The first place I would start, is to clean your project and rebuild. While you’re at it, take your prefs file and pitch it in the trash. I find it very valuable to get rid of my preferences often anyways, as it allows me to work on making sure that my preferences are user-proof. While it’s often a pain to have to keep setting preferences, I like to know what my user experience will be, and also prefer to find problems (as you’re doing) before my users do. Of course, you can keep a copy of the plist file if it’s got too much data to want to rebuild, but I’ve seen times where previous versions of my code didn’t write my prefs in the same way that my newest code does, so it breaks when I try to access my old prefs.

That’s where I’d start. Clean everything, rebuild, and start with a new set of prefs. If you’ve still got a problem, we’d need to confirm that we’re really throwing an error on that particular line, and perhaps take a look at other code that might somehow be interfering.

Good luck,
j

Parrot, I too had this problem when I tested your project. :confused:

The quote there is what does work. “Hidecorrupts” does not error. However, “HideCorrupt” does. I’m just confused as to why a single letter would make that difference.