Reputation: 2936
I'm looking for something like:
with car.body.wheel
begin
.airPressure = 3.0;
.diameter = 20;
end
I could write a macro for it I guess, but was wondering if there is anything build-in.
Upvotes: 0
Views: 227
Reputation: 3091
The answer is no, there is no such thing in Objective C.
Just do this
XObject *x = car.body.wheel;
x.airPressure = 3.0;
x.diameter = 20;
Of course, change XObject
to whatever type wheel
is
Update: got rid of the id syntax
Upvotes: 3
Reputation: 21373
No. Rather than writing a macro for it, which is likely to make your code hard for other Objective-C programmers to read, you should just do it the normal ObjC way:
car.body.wheel.airPressure = 3.0;
car.body.wheel.diameter = 20;
Upvotes: 3