My guess, judging by the code you provided, is that you probably aren't allocating your array properly. When creating objects, you also need to initialize them. Therefore:
Kana *htemp = [Kana alloc];
Must be:
Kata *temp = [[Kana alloc] init];
All objects must be initialized this way. Thus, if I am right, and you did not initialize your array, then your creation should go from this:
NSMutableArray *hiragana = [NSMutableArray alloc];
:
NSMutableArray *hiragana = [[NSMutableArray alloc] init];
For optimization reasons, you should probably also specify an initial capacity if you have an idea of ββhow many objects you can store:
[[NSMutableArray alloc] initWithCapacity:someNumber];
Matt ball
source share