Re: makeObjectsPerformSelector on a sub class
Re: makeObjectsPerformSelector on a sub class
- Subject: Re: makeObjectsPerformSelector on a sub class
- From: Jens Alfke <email@hidden>
- Date: Wed, 21 Mar 2012 12:17:50 -0700
On Mar 21, 2012, at 7:56 AM, Pascal Harris wrote:
> [[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.
No, that isn’t an issue. It will be called correctly regardless of where the method was introduced.
Are you sure that the array [self.view subviews] actually contains your views? If it’s empty, nothing will happen. If it contains any views that aren’t of your subclass, you’ll get an exception raised. Try setting a breakpoint at the line you’ve shown, and enter “po [[self view] subviews]”.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden