hi, i am new to properties and never knew their capabilities untill now.
Unfortunatly i cannot harness their capabilities as i am having an error.
Here is my code:
Code:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
ball = [Ball alloc];
ball.position = CGPointMake(100.0, 100.0);
ball.velocity = CGPointMake(4.0, 3.0);
}
(object ball was made in the .h)
(the errors are happening on ball.position, and ball.velocity.)
Ball.h:
Code:
@interface Ball : NSObject {
CGPoint *position;
CGPoint *velocity;
CGFloat *radius;
CGColorRef *color;
}
@property(nonatomic) CGPoint *position;
@property(nonatomic) CGPoint *velocity;
@property(nonatomic) CGFloat *radius;
@property(nonatomic) CGColorRef *color;
no errors here, but there is probably a problem causing the error.
The error is:
Code:
Assigning to 'CGPoint *' (aka 'struct CGPoint *') from incompatible type 'CGPoint' (aka 'struct CGPoint')
Looking at the error message, i am guessing it has something to do with having one CGPoint be a pointer, and the other not being a pointer. I am not for sure and don't want to screw anything up.
Thanks for your help!
-SumoSumo Apps