I create a new object:
And allocate it
And I get the error that the expression is not assignable. I can assign the property to another variable of that type but I can't change its components. Why is it not assignable and how do I make it assignable?
Code:
@interface Particle : NSObject
struct vec3 {
float x;
float y;
float z;
};
typedef struct vec3 vec3;
@property (readwrite, nonatomic) vec3 vec;
And allocate it
Code:
Particle *p = [Particle new];
p.vec.x = 0; // Error
And I get the error that the expression is not assignable. I can assign the property to another variable of that type but I can't change its components. Why is it not assignable and how do I make it assignable?