Re: Dictionary keys
Re: Dictionary keys
- Subject: Re: Dictionary keys
- From: sinclair44 <email@hidden>
- Date: Wed, 12 Mar 2003 20:50:46 -0500
On 3/12/03 8:26 PM, "Hisaoki Nishida" <email@hidden> wrote:
>
I get a signal 11 SIGSEGV error when I try to do the following:
>
>
[anArray objectForKey:NSStringFromPoint(newPoint)];
>
>
anArray is an NSMutableArray, and objects contained in it are stored
>
with the key NSStringFromPoint(somePoint).
>
They are both strings, so why wouldn't it work?
>
>
Thanks.
(I'm assuming you meant 'aDictionary' instead of 'anArray'.)
The obvious: is newPoint a valid point? Try this:
NSString *newPointString = nil;
NSPoint newPoint = [anObject determineNewPoint]; // or whatever
newPointString = NSStringFromPoint(newPoint);
NSLog(@"newPointString = %@", newPointString); // see what this prints out
NSLog(@"ObjectAtKey = %@", [aDictionary objectForKey:newPointString]); //
and what this does (or if it causes SIGSEV)
--
-- sinclair44
[self becomeWorldDictator];
- (void)becomeWorldDictator
{
[[GeorgeBush principalClass] assassinate:[world currentLeaders]];
[[world citizens] terrorize];
[world setCurrentLeaders:[NSArray arrayWithObject:self]];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.