Resolving EXC_BAD_ACCESS Issue In Cocoa?

后端 未结 4 1155
佛祖请我去吃肉
佛祖请我去吃肉 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:46

    This line:

    [cloudList release];
    

    is suspect because you didn't alloc or retain cloudList -- it is likely returned as autorelease, but read the docs for ASICloudFilesObjectRequest.

    Even so, I don't think that's your problem -- it would cause problems later once it was overreleased.

    I see a lot of releases that seem to be bad -- because I don't see corresponding allocs or retains. You need to read the rules of memory management for Objective-C (or move to automatic reference counting)

    I documented debugging techniques for EXC_BAD_ACCESS here:

    http://loufranco.com/blog/files/Understanding-EXC_BAD_ACCESS.html

    Easy things to try:

    1. Run Build and Analyze (fix everything)
    2. Turn on zombies

提交回复
热议问题