Memory leak in NSString stringWithUTF8String: with ARC enabled

后端 未结 1 1831
别那么骄傲
别那么骄傲 2020-12-21 19:19

In my application i have enabled the ARC. But in my application following lines gives me memory leaks according to instruments. It is in ios 7.0.

-(id)init{
         


        
相关标签:
1条回答
  • 2020-12-21 20:01

    My guess right now is that your entire object is leaking, which means that the NSMutableArrays created in -init also leak. The version that calls copy isn't leaking because the copy is probably returning a singleton instance of NSArray (as there are zero elements in it, and it's an immutable NSArray, there's probably a singleton instance for that).

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