objective c - Pressing UIButton results in Unrecognized Selector error -


I have a button in my UIView that is created like this:

  UIBarButtonItem * editButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemEdit Goal: auto operation: @selector (toggleEdit)]; Self.navigationItem.rightBarButtonItem = editButton; [Edit Button Release];   

And this is the action method:

  - (zero) toggleEdit: (id) this {}   

But I get this error

2011-09-02 15: 27: 13.362 blubb [15006: 207] - [DatabaseSelectionViewController toggleEdit]: Unfolded selector sent for example 0x5a29d80 2011-09 -02 15: 27: 13.365 blubb [15006: 207] * Unexpected exception 'NSInvalidArgumentException', the application ended due to reason: '- [DatabaseSelectionViewController toggleEdit]: Unrecognized selector example 0x5a29d80 Sent to '

Why is this happening?

change

  @selector (toggleEdit)  < / Pre> 

to

  @selector (toggleEdit :)    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -