• 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: using appendBezierPathWithPoints
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using appendBezierPathWithPoints


  • Subject: Re: using appendBezierPathWithPoints
  • From: "William Zumwalt" <email@hidden>
  • Date: Fri, 13 Jul 2007 19:40:34 -0500



1. Your code treats 'points' as an array of arrays of NSPointArrays.
This is almost certainly wrong.

2. calloc().


I've been looking at pointers to arrays trying to figure out where I've gone
wrong. I'm still not sure if I've got the correct number of pointers here. I
think it is. But I'm still having a problem showing the correct values in my
graph.


This is how I'm stuffing NSPoints into an NSPointArray which is typedef'd to NSPoint *.


NSPointArray points;


- (id) initWithFrame:(NSRect) frameRect

{

if (self = [super initWithFrame:frameRect]) {

pointCount = 0;

// I hate hardcoding this, but I don't know the number

// of points I'll need during runtime. Must do something better.

points = (NSPoint *) calloc(200, sizeof(NSPoint));

}

return self;

}



// And I populate them as such ...

NSPoint point = NSMakePoint(x, y);

points[pointCount] = &point;

pointCount++;


And then I'll pass this to Quartz as ...

[path appendBezierPathWithPoints:points count:pointCount];


I found that I had too many levels of indirection before, but this is as close as I've gotten so far. Anyone see anything wrong with the way I'm stuffing points into appendBezierPathWithPoints:? _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: using appendBezierPathWithPoints
      • From: Andrew Farmer <email@hidden>
References: 
 >using appendBezierPathWithPoints (From: "William Zumwalt" <email@hidden>)
 >Re: using appendBezierPathWithPoints (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Using proxy objects with NSMutableArray
  • Next by Date: Re: using appendBezierPathWithPoints
  • Previous by thread: Re: using appendBezierPathWithPoints
  • Next by thread: Re: using appendBezierPathWithPoints
  • Index(es):
    • Date
    • Thread