I have swift project. I am stuck at one line to convert in objective c
var bezierPoints = [CGPoint](repeating: CGPoint(), count: 5)
How can I make array in objective C?
In Objective-C you cannot create an array of CGPoint(s) because NSArray can only contain objects.
Anyway you can wrap a CGPoint into a NSValue so
NSArray * points = [NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
nil];
Or as suggested by @Alexander Momchliov
NSArray * points = @[
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
[NSValue valueWithCGPoint:CGPointZero],
];
@[a, b, c]
CGPoint bezierPoints[5];satisfy your needs?