• 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: Using NSNotificationCenter passing an object or value?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSNotificationCenter passing an object or value?


  • Subject: Re: Using NSNotificationCenter passing an object or value?
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 3 Aug 2010 13:15:06 -0700

On Aug 3, 2010, at 13:00, Eric E. Dolecki wrote:

> WHen you say it takes an NSNotification object as a parameter, you mean to say that it's missing, correct?

Yes, as in:

- (id)initWithFrame:(CGRect)frame {
   if ((self = [super initWithFrame:frame])) {
       mydata = [[NSArray alloc] init];
       menuItems = [[NSMutableArray alloc] initWithCapacity:40];
       [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(buttonClicked:)  name:@"ButtonClicked" object:nil];
// note the colon in the selector now
   }
   return self;
}

-(void) buttonClicked: (NSNotification*) notification {
	UIButton* button = notification.object;
	NSUInteger tag = button.tag;
}
_______________________________________________

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

  • Follow-Ups:
    • Re: Using NSNotificationCenter passing an object or value?
      • From: eric dolecki GMail <email@hidden>
References: 
 >Using NSNotificationCenter passing an object or value? (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Using NSNotificationCenter passing an object or value? (From: Quincey Morris <email@hidden>)
 >Re: Using NSNotificationCenter passing an object or value? (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: GKPeerPickerController: can't connect from the simulator?
  • Next by Date: Re: Need help understanding first responder and multiple nibs
  • Previous by thread: Re: Using NSNotificationCenter passing an object or value?
  • Next by thread: Re: Using NSNotificationCenter passing an object or value?
  • Index(es):
    • Date
    • Thread