• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: makeObjectsPerformSelector on a sub class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makeObjectsPerformSelector on a sub class


  • Subject: Re: makeObjectsPerformSelector on a sub class
  • From: Seth Willits <email@hidden>
  • Date: Wed, 21 Mar 2012 12:09:59 -0700

On Mar 21, 2012, at 7:56 AM, Pascal Harris wrote:

> 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.

That's definitely not the reason. Making a method call in that way doesn't care what class in the hierarchy, or even what category on any of those classes the method is implemented at. The method will always be called even if the object *doesn't* implement it.

The only reasons it wouldn't be called are:

0) self is nil
1) self.view is nil
2) self.view has no subviews.


--
Seth Willits


_______________________________________________

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

References: 
 >makeObjectsPerformSelector on a sub class (From: Pascal Harris <email@hidden>)

  • Prev by Date: Re: Missing header files/folders?
  • Next by Date: Re: makeObjectsPerformSelector on a sub class
  • Previous by thread: makeObjectsPerformSelector on a sub class
  • Next by thread: Re: makeObjectsPerformSelector on a sub class
  • Index(es):
    • Date
    • Thread