Your modifying an array that is being enumerated, which is illegal.
--
David Duncan @ My iPhone
On Nov 30, 2009, at 2:23 PM, Matt Neuburg <[email protected]> wrote:
To remove all sublayers from a layer, it is sufficient to set that
layer's
sublayers property to nil, so this code is completely unnecessary.
But I'm
just curious as to why it doesn't work:
for (CALayer* sub in myview.layer.sublayers)
[sub removeFromSuperlayer];
This crashes as if the fast enumeration itself were somehow illegal.
Why?
Thx -
m.
--
matt neuburg, phd = [email protected], <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
This email sent to [email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]