How do i resolve EXC_BAD_ACCESS errors encountered in iphone development

后端 未结 8 593
执念已碎
执念已碎 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:52

    take the slash off the path, and make sure it is in the project. doesn't matter if it is in that dir, but it has to be added to the project for you to access it.

    0 讨论(0)
  • 2020-12-13 21:53

    Your code shows a severe lack of knowledge of how memory management works in Objective-C. In addition to the EXC_BAD_ACCESS errors you're receiving, improper memory management also causes memory leaks which, on a small device like the iPhone, can lead to random crashes.

    I recommend you give this a thorogh read:

    Introduction to Memory Management Programming Guide for Cocoa

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