How do i resolve EXC_BAD_ACCESS errors encountered in iphone development

后端 未结 8 596
执念已碎
执念已碎 2020-12-13 20:54

I\'m trying to do a simple thing; read an image from the internet, save it to the app\'s documents directory on the iphone, and read it back from that file so that i can do

8条回答
  •  死守一世寂寞
    2020-12-13 21:42

    Definitely give memory management rules a quick review. Nothing jumps out that would cause the error you're getting, but you're leaking all those objects your allocating. If you don't understand the retain/release pattern, chances are there's another spot in your code where you're not retaining an object properly, and that's whats causing the EXC_BAD_ACCESS error.

    Also note that NSString has methods for dealing with filesystem paths, you should never have to worry about the separator yourself.

提交回复
热议问题