Saturday, June 2, 2012

The "Frustrating" Category

This was supposed to be an easy topic. Categories. I get it. I pretty much get all that Kochan talks about regarding this topic. Nevertheless, I had major problems that took me hours to [sort of] solve. There was nothing wrong with my code but I could not get the category to access the class's synthesized instance variables. They were not recognized. I pored over many websites. Even in Kochan's example, he uses the instance variables. For whatever reason, the compiler said that they were undeclared identifiers. Wrong! They were declared in the class! I checked other people's code and their's seemed to work. Mine didn't. I wasted hours trying to figure it all out and I ended up using the [self numerator] directive instead of the plain old numerator.

Hey, I was just going by what the book said. It said that I can use any object from the class as if I were in the actual class. Unless I declared my category incorrectly, which I don't think I did, then there is an issue in there somewhere. Well, regardless, I did not progress in the chapter. I did do a lot of reading on categories and a lot of searching for answers, but I am holding steady on page 224. I had hoped that I would have made it to the exercises at the end of the chapter by now. I have not even gotten to the section on Class Extensions! It is 11:45 and I am tired. Signing off.

No comments:

Post a Comment