views:

164

answers:

1

Curious, how does an NSMutableArray mutate into a type of UIButtonContent? I'm currently working with an instance variable of type NSMutableArray which crashes upon receiving an error with:

*** -[UIButtonContent count]: unrecognized selector sent to instance 0x393ed0

Wasn't even aware of UIButtonContent, so not explicitly working with that type anywhere. Not sure how about my array came to become one. Looking for insight as to where I might have gone wrong.

+2  A: 

Don't think of it as 'mutating,' think of it as your pointers getting mixed up and pointing to the wrong object. One way this could happen is if your mutable array is deallocated by accident, and a UIButtonContent object is put into memory in its old location. The pointer won't know the difference unless you manually change it.

Marc Charbonneau