views:

59

answers:

2

I am having a strange error in the program. However, I do not find any syntax error. The error is: expected ')' before 'NSRect'. How can I get rid of it? I get those errors in line 1 and 2. I also tried importing Foundation/NSGraphics.h. It did not work.

#import <Foundation/Foundation.h>
@interface MyQuartzView : NSObject {

 }
- (id)initWithFrame:(NSRect)frameRect;//line 1
- (void)drawRect:(NSRect)rect;//line 2
@end
A: 

I dont know why its not defined from the foundation header but try using CGRect.

It is functionally equivalent and is defined in the foundation headers

From Apple's docs:

When building for 64 bit systems, or building 32 bit like 64 bit, NSRect is typedef’d to CGRect.

Akusete
+1  A: 

NSRect, NSSize, NSPoint, and similar types aren't available on the iPhone. Use CGRect/CGSize/CGPoint instead.

jtbandes