Re: NSPoints in an NSMutableArray
Re: NSPoints in an NSMutableArray
- Subject: Re: NSPoints in an NSMutableArray
- From: "John C. Randolph" <email@hidden>
- Date: Thu, 6 Feb 2003 11:18:52 -0800
On Thursday, February 6, 2003, at 10:14 AM, Arthur VIGAN wrote:
I have a little problem with the NSPoint class.
In Objective-C, NSPoint isn't a class. It's a plain old C struct.
I try to store NSPoint objects in an NSMutableArray with:
[myArray addObject:NSMakePoint(x, y)];
but when I compile I got the following error for the previous line:
PlotView.m:83: incompatible type for argument 3 of indirect function
call
Is it a known problem?
If you want to store a point in an NSArray, wrap it up in an NSValue
object:
[myArray addObject:[NSValue valueWithPoint:NSMakePoint(x,y)]];
If you're going to be doing mathematical operations on many points, you
might want to use an NSData object instead.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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.