I can understand defining the functions in the @interface of the header file, but why the instance variables? Shouldn\'t the instance variables be private, only accessible
Although they are declared in the header file, all instance variable in Objective-C have @protected access by default. This means the variable is accessible within the class that declares it and any class inheriting from that class.
Here is Apple's documentation on defining an Objective-C class: Defining Classes
Notice the section titled "The Scope of Instance Variables".