Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableDictionary & Strings - Weird, weird problem




Use the debugger. Set a breakpoint on -[NSException raise] and let us know what you find.


Also, post your code. At this point it looks like you may be loading the contents of your file as a string and trying to treat it as an NSMutableDictionary. You could also be trying to manipulate preferencesDictionary but it's since been released (or autoreleased) and the address is no longer valid.

We can't tell because we have no idea what you're actually doing (since you haven't posted your code). All we've got are guesses. :-)

--
I.S.


On Jun 30, 2006, at 4:33 PM, Bobby B wrote:

Hey guys

In my program, I have a NSMutableDictionary that I save to a .plist,
and reload on startup.  I'm having an extremely odd problem with it.

Some of the strings I want to save are strings that look like URLs,
but they are strings.  It seems to save them fine, but when I load the
Dictionary back from the harddrive, it crashes out on me and gives me
an error:

2006-06-30 16:21:56.243 AMP[3509] http://www.mp3car.com/vbulletin/
2006-06-30 16:21:56.252 AMP[3509] An uncaught exception was raised
2006-06-30 16:21:56.271 AMP[3509] [<NSCFString 0xa3cb300>
valueForUndefinedKey:]: this class is not key value coding-compliant
for the key SYSTEM_VOLUME.
2006-06-30 16:21:56.332 AMP[3509] *** Uncaught exception:
<NSUnknownKeyException> [<NSCFString 0xa3cb300>
valueForUndefinedKey:]: this class is not key value coding-compliant
for the key SYSTEM_VOLUME.


(But SYSTEM_VOLUME isn't the related key. The related key is something totally different - and SYSTEM_VOLUME, along with every other key look perfect when I view the .plist in an editor)

Here is a specific string it crashes on:

http://www.mp3car.com/vbulletin/
It crashes on that, but the following it has no problem with:
http://www.mp3car.com/
Nor does it have a problem with this:
http://www.aychamo.com/?page_id=4

So what is it in /vbulletin/ that causes it to crash?  I can't for my
life figure this out.  I've been playing with it all day and feel as
though I've hit a wall. Whatever it is in that string, it sure makes
it crash.  This is the line of code I use to set the string value into
the dictionary:

[preferencesDictionary setValue:[browserAddress stringValue]
forKey:@"BROWSER_FAVORITES_1"];

(browserAddress is just a NSTextField)
And then I just save the dictionary to a file.. seem's pretty harmless to me.


Does anyone have an idea where I should start looking??
Thank you
Bobby
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005% 40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >NSMutableDictionary & Strings - Weird, weird problem (From: "Bobby B" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.