john doe
john doe

Reputation: 9660

Returning CGPoint from a Method in Objective-C

I have the following code:

#import <Foundation/Foundation.h>


@interface BBUtils : NSObject
{

}


-(CGPoint ) randomPoints;

@end

For some reason it complains on the randomPoints method saying Expected a Type? Why?

Upvotes: 0

Views: 546

Answers (2)

pronebird
pronebird

Reputation: 12230

Add proper import in your header to expose structs declared by CoreGraphics:

#import <CoreGraphics/CoreGraphics.h>

Upvotes: 2

Claus J&#248;rgensen
Claus J&#248;rgensen

Reputation: 26351

This could happen if CoreGraphics is not available. Then you'll need to link it explicitly:

enter image description here

Upvotes: 4

Related Questions