开发者

Mutable Array Remove all objects Crash Exe Bad Access

I am creating a database using sqlite and have all my methods written for inserting, reading, deleting etc.

When i re开发者_StackOverflow中文版ad the database the first time my read method works fine, clearing the array using removeallobjects.

When it is called the second time it crashes the app with the 'exe bad acces's on the [array removeallobjects];

From my experience this is because it is already been released, but i cant find or see where and why this is happening. I can add to the array fine as long as i comment out the calling of the read method. It also works commenting out the remove all objects so its this its having an issue with.

I have written another app in the past that has had no issue and the code is pretty much identical. Is there a way to see if its being released or is this possibly an issue with xCode4?

Any help would be great as i cant dev any further..

Thank Dan


Try using the Zombie-Instrument (Profiling), that shows you exactly where you access an already deallocated object and when it has been released/retained since its creation


You could always check if it is released or not before removing objects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜