-2

Hi I need to make a 2D arch. Where I am getting a problem here

arc.path=[UIBezierPath bezierPathWithArcCenter:CGPointMake(50, 100)
                                                  radius:80.0
                                                  startAngle:DEGREE(65)
                                                  endAngle:DEGREE(90)
                                                  clockwise:NO].CGPath;

I am getting an error that

Undefined symbols for architecture i386: "_DEGREE", referenced from:

I know I have not included some header file, May I know which one is to include?

user1931542
  • 29
  • 1
  • 3

3 Answers3

10

DEGREE is macro, not a method!!!

As you can easily guess by its name. Naming conventions come into play

You have to define it might be as :

#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)

or

#define DEGREE(angle) ((angle) / 180.0 * M_PI)
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
7

It should be custom macro you can also declare yourself and give it to your name. Try as following, put it anywhere in your header or implementation file.

#define DEGREE(radians) ((radians) * (180.0 / M_PI))
Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99
0

Hope it works for you...

(CGFloat) radians:(CGFloat) degrees
{
    CGFloat angle = degrees * M_PI / 180.0;
    return angle;
}

@Matthias Bauch: Thanks for the info.

iCreative
  • 1,499
  • 1
  • 9
  • 22