You are never instantiating _ons
. Somewhere in your code, you need to call:
self.ons = [[NSMutableArray alloc] init];
(In case you’re new to Objective-C, your code wasn’t crashing because messages to nil
are no-ops that return 0, instead of crashing like in some other languages.)