• 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: Gregory Weston <email@hidden>
  • Date: Wed, 21 Mar 2012 18:13:00 -0400

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 not how Objective-C works. You can send any message to any object. It may not respond well, but there's nothing filtering the send.

My money is on: self.view is nil at the time this code executes.



_______________________________________________

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

  • Prev by Date: Re: Odd initial save behavior with bundle based NSDocument
  • Next by Date: Re: How to get max size of view according to constraints?
  • Previous by thread: Re: makeObjectsPerformSelector on a sub class
  • Next by thread: NSData, CFData maximum length question
  • Index(es):
    • Date
    • Thread