Example Issues

I’m having issues changing BMITime as in the example. In the very start of the chapter, you’re asked to update BNREmployee.h and BNREmployee.m, and then run. It’s 3 changes. I get an error in my remove asset telling me there is no visible @instance for NSMutableSet declares he selector ‘removeObjectAtIndex’. The book then call out how this might be an issue, but at the same time says the program should run the same. What am I missing?

Hi mate, I got the same error when building the program then quickly realised why.

Because Sets don’t have an order, they also have no index, as explained in the book, so the class method ‘removeObjectAtIndex’ will not work with sets. You can either comment out that line in your remove statement, or fix up the method by using appropriate an appropriate Set method.

I found this frustrating, too.

I didn’t want to comment out the offending line, so I changed the line in main.m to: