Now instead of wondering what’s going on and which exact object produced the problem, you’ll see exactly which class is the trouble maker, and you’ll debug it quite fast. In “Variables to be set in the environment” (that’s the list at the bottom, be careful which one you edit) click the “+” button and for name of the variable enter “NSZombieEnabled” and for value “YES”.Double click your executable in the “Executables” in XCode.When this feature is enabled, a dummy object (a zombie) is kept on the place of every released object, thus allowing to debug objects which were released already. The solution to overreleased objects are the zombies. That’s really tough to debug with NSLog … NSLog is helpful, but you need to put 1,000 NSLogs around to fetch where is the problem. This is because the object is gone, there is no information what class was it, or what source file or anything else. In this cases everything (and indeed everything) you will get in the console will be just : What’s happening most though is that you will be sending a message to an overreleased object – i.e. Start using the debugger, if you recently added a new object to the class you’re working on, put a breakpoint at the line before the freshly added object is used for the first time and check the values in the debugger. Something else that is not very likely to happen.This article however is about how to make the process easier, in some cases easy as a piece of cake.ĮXC_BAD_ACCESS means that message was sent to a point in the memory where there’s no instance of a class to execute it. You have to accept the fact that sooner or later you will need to debug an EXC_BAD_ACCESS problem and most probably won’t be easy to. ![]() ![]() This article is from, useful for debugging the annoying EXC_BAD_ACCESS exception.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |