I am working on a game. The game has different levels but share the same methods. I was thinking about subclassing the main game class.
How can i subclass the main game class(the main game class is a subclass of viewcontroller with xib)? Can i overrider the xib with subclass’s xib?
//my main game class.
@interface Game : UIViewController{
//subclass
import <UIKit/UIKit.h>
import "Game.h"
@interface level1 : Game {
}
when i used level1.view, it gave me an error”accessing unknown view class method)
It it is impossible, how can i create a game with different levels~~ thanks
This looks like you are calling
[level1 view]. This is an attempt to call a class method name+view. There is no such class method. You are attempting to get to an instance method name-view.BTW: It is the usual practice to have a capital letter begin a class. So the class name should be
Level1notlevel1.