• 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
new to cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new to cocoa


  • Subject: new to cocoa
  • From: Alejandro Marcos Aragón <email@hidden>
  • Date: Tue, 11 May 2010 15:36:12 -0500

Hi all,

I'm new to Cocoa, and I couldn't find information about an error that I'm getting on the web. I'm trying to create an NSMutableDictionary where the keys are of type UIButton*:


			// create button for unit
			UIButton* unitButton = [[UIButton alloc] init];
			[sourceButtonMap setObject:[NSString stringWithString:@"no"] forKey:unitButton];

Of course, the sourceButtonMap is defined in the class and initialized in the init function as sourceButtonMap = [[NSMutableDictionary alloc] init];

The error I get when I try to add the key-value pair is:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIButton copyWithZone:]: unrecognized selector sent to instance 0x3931e90'

Is this happening because I can't store UIButton* as keys?
Can anyone point me why I'm getting this error? Thank you all,

aa_______________________________________________

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: new to cocoa
      • From: William Squires <email@hidden>
    • Re: new to cocoa
      • From: Jens Alfke <email@hidden>
    • Re: new to cocoa
      • From: Kiel Gillard <email@hidden>
    • Re: new to cocoa
      • From: Dave DeLong <email@hidden>
  • Prev by Date: NSArrayController Undo
  • Next by Date: iPhone: viewDidAppear called, Default.png still visible
  • Previous by thread: Re: NSArrayController Undo
  • Next by thread: Re: new to cocoa
  • Index(es):
    • Date
    • Thread