Another option would be a container holding just the tiles.

On Wed, Mar 21, 2012 at 5:06 PM, James Bucanek <[email protected]>wrote:

> Pascal Harris <mailto:45rpmlists@googlemail.**com<[email protected]>>
> wrote (Wednesday, March 21, 2012 7:56 AM -0000):
>
>
>  Now I want to scramble the state of each of the tiles.  In the game
>> controller, I'm using the following code:
>>
>> [[self.view subviews] makeObjectsPerformSelector:@**
>> selector(scrambleState)];
>>
>> I've put a breakpoint in scrambleState - and it never gets called. I'm
>> guessing that 'makeObjectsPerformSelector' fails to work because
>> scrambleState
>> is not a method in UIView. Question is, what do I need to do in order to
>> ensure that this code gets called?
>>
>
> Others have made a lot of valid suggestions and points, but if it wasn't
> mentioned I have another reason this would fail:
>
> You must ensure that *all* subview of self.view implement -scrambleState.
> The first object in the collection that doesn't implement this method will
> throw an exception and the iteration will stop.
>
> Safer, although longer, would be:
>
> // (warning: typed in mail)
> UIView* subview;
> for ( subview in self.view.subviews )
>    if ([subview respondsToSelector:@selector(**scrambleState)])
>        [subview scrambleState];
> --
> James Bucanek
>
>
>
> ______________________________**_________________
>
> 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<http://lists.apple.com>
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/**mailman/options/cocoa-dev/**
> griotspeak%40gmail.com<https://lists.apple.com/mailman/options/cocoa-dev/griotspeak%40gmail.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to