[CFNumber release]: message sent to deallocated instance

丶灬走出姿态 提交于 2019-12-03 16:04:18

According to the Transitioning to ARC Release Notes:

To allow interoperation with manual retain-release code, ARC imposes a constraint on method naming:

  • You cannot give an accessor a name that begins with new. This in turn means that you can’t, for example, declare a property whose name begins with new unless you specify a different getter:

        // Won't work:
        @property NSString *newTitle;
    
        // Works:
        @property (getter=theNewTitle) NSString *newTitle;
    

Bottom line, methods that start with new are assumed to return an object that ARC is responsible for managing and releasing (but this isn't the case here). I'd suggest just changing your property so that it doesn't start with new to avoid any confusion.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!