Resolving EXC_BAD_ACCESS Issue In Cocoa?

后端 未结 4 1161
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-23 15:00

Hey..i have the following method in cocoa..

-(void)startUploadWithContainerName:(NSString *)containerName
{
//Make an object of NSFileManager and Fetch an          


        
4条回答
  •  心在旅途
    2021-01-23 15:23

    it's likely a reference count issue.

    to diagnose:

    • run the static analyzer
    • fix all static analyzer issues
    • test

    still having problems after fixing the static analyzer results? no problem:

    • in Instruments, you can enable zombie detection and record allocation history and reference counts.
    • run your app, performing steps required to repro the issue
    • Instruments will halt execution when a zombie is messaged.
    • then find the allocation/object that was messaged and step through its lifetime/ref count history.

    this makes locating over-released objects very easy to find (e.g. from hours in some cases to minutes).

提交回复
热议问题