cannot init a class object : objective-C

If you are here just like me wondering why you code is crashing.

 [NSArray init];

should be :

[[NSArray alloc] init];

or

[NSArray array];

You crash could caused by any other class here NSArray here is for reference only.


Couple things,

In Obj-c when you want to initialize an Object, you need to allocate space for it. That is done using the alloc keyword.

so your ContentPane *pane = [ContentPane init];

turns into ContentPane *pane = [[ContentPane alloc] init];

Also, whatever tutorial you are following, Stop... the way you have declared your variables we call them (iVars) is a very old fashioned way of doing things, they should really be properties. and Boolean values are represented by YES and NO not TRUE and FALSE