NSNumber >= 13 won't retain. Everything else will

前端 未结 2 517
春和景丽
春和景丽 2021-01-01 04:48

The code I\'m currently working on requires adding an NSNumber object to an array. All of the NSNumbers with value 0-12 are added fine, but 13 onward causes a EXC_BAD_ACCESS

2条回答
  •  旧时难觅i
    2021-01-01 05:45

    Clearly NSNumbers >12 will retain. I suggest that you write a very small program that proves this to yourself. Then take that program, make it a function, and call it early in your program. Slowly move the function to later points in your program until the error appears. You will thus find your real bug.

提交回复
热议问题