• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPoints in an NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSPoints in an NSMutableArray (From: Arthur VIGAN <email@hidden>)

  • Prev by Date: Re: NSPoints in an NSMutableArray
  • Next by Date: NEWBIE: where to start my thread
  • Previous by thread: Re: NSPoints in an NSMutableArray
  • Next by thread: RE: NSPoints in an NSMutableArray
  • Index(es):
    • Date
    • Thread