Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Different issue with Chapter 5's Swap ...

I've built the Swap project in Chapter 5 as the book indicates.  The button rotation works just fine for me going to and from portrait.  The issue that I'm having is in the last section "Changing Outlet Collections".

I replaced the "buttonTapped" method with the if statement and two for loops the book shows on page 137 and ran the program.

Tapping "Foo" button works fine.  But tapping "Bar" button results in the app crashing with the button still in the "pressed" state (it's blue instead of white) and I get the following information dumped in the debugger:

2013-02-07 13:16:45.904 Swap[924:c07] -[UIRoundedRectButton countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x71eeb60

2013-02-07 13:16:45.983 Swap[924:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIRoundedRectButton countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x71eeb60'

*** First throw call stack:

(0x1c93012 0x10d0e7e 0x1d1e4bd 0x1c82bbc 0x1c8294e 0x3056 0x10e4705 0x182c0 0x18258 0xd9021 0xd957f 0xd86e8 0x47cef 0x47f02 0x25d4a 0x17698 0x1beedf9 0x1beead0 0x1c08bf5 0x1c08962 0x1c39bb6 0x1c38f44 0x1c38e1b 0x1bed7e3 0x1bed668 0x14ffc 0x26bd 0x25e5)

libc++abi.dylib: terminate called throwing an exception


As far as I can tell, the code I've used matches the code in the book.  Any other thoughts on what might be causing this?  Thanks.


  • just a question why is there a countByEnumeratingWithState:objects:count message? is it in the (IbAction) buttonTapped Method? 
Sign In or Register to comment.