Jack
Jack

Reputation: 151

@property for Core Foundation variable

In my program I am setting up core foundation variables using automatic reference counting. For my @interface I use:

@property (nonatomic, assign) CGRect home;

In my @implementation I use:

@synthesize home;

I am getting an error "Type of property 'home" ('struct CGRect') does not match type of ivar 'home' ('struct CGRect *). Please advise so I can keep my getters and setters for the CGRect variable.

Thanks in advance.

Upvotes: 1

Views: 151

Answers (1)

grahamparks
grahamparks

Reputation: 16296

In your interface you must have something like this:

@interface MyClass: NSObject {
    CGRect *home;
//         ^ here's your problem
}
@property (nonatomic, assign) CGRect home;
@end

Delete the asterisk from CGRect *home.

Upvotes: 2

Related Questions