• 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: UIBezierPath: trying to create an array with CGPointMake
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIBezierPath: trying to create an array with CGPointMake


  • Subject: Re: UIBezierPath: trying to create an array with CGPointMake
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 20 Dec 2010 09:58:28 -0600

On 20 Dec 2010, at 1:20 AM, colo wrote:

> I'm in the processing of trying to create an array of Path points to
> draw a UIBezierPath CGRectMake onto each control point.
>
> Right now I am getting an error of
> error: void value not ignored as it ought to be
…
> - (IBAction)resetControlPoints:(id)sender
> {
>
> UIBezierPath *path = [UIBezierPath bezierPath]; {
> [path moveToPoint:CGPointMake(0,0)];
> return path;
> }
> points[0] = 	[path moveToPoint:CGPointMake(30, 70)];
> points[1] = 	[path moveToPoint:CGPointMake(30, 70)];
> points[2] = 	[path moveToPoint:CGPointMake(30, 70)];
> points[3] = 	[path moveToPoint:CGPointMake(30, 70)];
>
> }

Look at the documentation for -[UIBezierPath moveToPoint:]. The method returns void, but you're trying to assign the (nonexistent) result to members of the points[] array. You ought to be ignoring the void value, and aren't, just as the error message says.

You're returning path immediately after initializing it. Your assignments to points[] won't get executed anyway.

You're attempting to return path from a void method (IBAction methods return void). Attempting to return a value from a void method is at least a warning. Never ignore warnings.

Given that you can't return anything from an IBAction — nothing will receive the returned value — what do you expect to happen to path? In the method you show, it gets allocated, autoreleased, initialized, and thrown away.

Assuming you mean to use the four {30,70} points you refer to, (points[0] = CGPointMake(30, 70);), why do you think it necessary to reset the current point to that location?

If you do mean to reset the current point, why do it four times?

Assuming you don't mean the early return, why initially set the current point to {0,0} if you're just going to reset it?

And why are you enclosing those two lines in braces?

	— F

_______________________________________________

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: UIBezierPath: trying to create an array with CGPointMake
      • From: colo <email@hidden>
References: 
 >UIBezierPath: trying to create an array with CGPointMake (From: colo <email@hidden>)

  • Prev by Date: Re: access multiple NSTextFields as an array?
  • Next by Date: Re: access multiple NSTextFields as an array?
  • Previous by thread: Re: UIBezierPath: trying to create an array with CGPointMake
  • Next by thread: Re: UIBezierPath: trying to create an array with CGPointMake
  • Index(es):
    • Date
    • Thread