A couple of questions/comments


#1

Q1. In this chapter, and probably some others, we add the method to our header, e.g. spinLabel:, and then implement that in the .m file. However, we obviously have no other .m calling the method. So why put it into the header? Shouldn’t this be reserved for making the method visible to other implementation files?

C1. When specifying an animation type such as opacity or transform, we use a string statement. However, this implementation does not allow error checking of the requested animation until runtime. Why did Apple choose such a method? It seems like this could have been done better using more common methods.

Jeff


#2

[quote=“physics90”]Q1. In this chapter, and probably some others, we add the method to our header, e.g. spinLabel:, and then implement that in the .m file. However, we obviously have no other .m calling the method. So why put it into the header? Shouldn’t this be reserved for making the method visible to other implementation files?
[/quote]

No, that is not the reason we declare it on the header (.h) files. As far as I know we do that separate declaration to help the compiler understand what resources our project will need, so that it can prepare for it in advance.

[quote=“physics90”]C1. When specifying an animation type such as opacity or transform, we use a string statement. However, this implementation does not allow error checking of the requested animation until runtime. Why did Apple choose such a method? It seems like this could have been done better using more common methods.
[/quote]

That’s a good question. I thought about the same thing when I was writing the code for the last challenges. At least a mistake here would be really easy to realize and fix.


#3

Thanks, Plastic. Are we the only ones on the board in these areas?

With regards to my first question, the variables, properties, and methods included in the header are declared as public, meaning other entities have access to them. Those not included in the header are private and therefore not accessible.

However, what you stated may be true as well.