Objects not being added to NSMutableArray Objective -C

前端 未结 2 1615
小鲜肉
小鲜肉 2021-01-06 16:35

I\'m trying to simply add objects to a mutable array but they WILL NOT insert. I\'m not getting errors or anything and I can\'t figure out whats going on.

In my main

相关标签:
2条回答
  • 2021-01-06 16:49

    Can you add the code where you initialize your NSMutableArray instances? I think you might have forgotten to initialise the arrays and your addObject calls are being swallowed up with no effect.

    0 讨论(0)
  • 2021-01-06 16:53

    Are you instantiating the properties anywhere, and if so, have you debugged through to verify that is the case? Otherwise you may be sending messages to nil, which will have no effect. Alternatively, you may be doing the array creation after this call, which would make it look like they're not added.

    0 讨论(0)
提交回复
热议问题