Documentation Archive Developer
Search
Table of Contents Previous Section

The Structures of init and awake

The init method must begin with an invocation of super's init method and must end by returning self.

	- init {
		[super init];
		/* initializations go here */
		return self;
	}
Likewise, in Java, the constructor must begin with an invocation of the superclass's constructor (as with all Java classes):

	public Application() {
		super();
		/* initializations go here */
	}
The awake method has no such structure. In it, you don't need to send a message to super or return anything.

	- awake {
		/* initializations go here */
	}
	public void awake () {
		/* initializations go here. */
	}

Table of Contents Next Section