EXC_BAD_ACCESS on NSLog with no string formatting

后端 未结 4 1889
梦如初夏
梦如初夏 2021-02-19 17:56

I\'m getting an EXC_BAD_ACCESS (or a malloc error) on the following line of code:

NSLog(@\"Points:\");  

Which makes zero sense to me, as it

4条回答
  •  一整个雨季
    2021-02-19 18:50

    In the comments I suggested:

    The problem is not with NSLog. The problem is probably that some memory is getting smashed and that is causing the crash in NSLog. It would probably help if you could break down that method you're using to make it easier to read, perhaps even separating the functionality into a new object. Also, avoid the use of magic numbers (3 & 6).

    It appears that @haldean went with this suggestion and tracked down the problem. I can't claim credit for actually doing the hard work of tracking down the problem, but I'm happy the suggestion helped.

提交回复
热议问题