ChipmunkObjectFlatten Deprecated?

Official forum for the Chipmunk2D Physics Library.
Post Reply
PDiTO
Posts: 2
Joined: Wed Oct 05, 2011 11:29 am
Contact:

ChipmunkObjectFlatten Deprecated?

Post by PDiTO »

I'm trying to follow along with the Objective-Chipmunk examples, namely the SimpleObjectiveChipmunk project, but I notice that ChipmunkObjectFlatten has been deprecated in 6.0.2?

Can anyone point me in the right direction as to how to get over this issue?

Thanks.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: ChipmunkObjectFlatten Deprecated?

Post by slembcke »

Ah, sorry about that. From the header:

Code: Select all

/// @deprecated since 6.0.2 Use [NSArray arrayWithObjects:] or similar instead.
NSSet * ChipmunkObjectFlatten(id <ChipmunkObject> firstObject, ...) __attribute__((deprecated));
So where you would have done:

Code: Select all

chipmunkObjects = [ChipmunkObjectFlatten(a, b, c, d, e, nil) retain];
Do one of this instead:

Code: Select all

chipmunkObjects = [[NSArray alloc] initWithObjects:a, b, c, d, e, nil];
The Chipmunk Object protocol was modified to work with any nested NSFastEnumeration objects (NSArray, NSSet, etc) instead of only the flattened NSSets that the ChipmunkObjectFlatten() method created. Originally I had created it that way for what turned out to be imaginary performance reasons. So I fixed it to be more flexible.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests