보통, release관련이다.
The most common cause of this error is when you release an object and some other mechanism tries to access/release/dealloc it later.
Whenever I get a report of
an EXC_BAD_ACCESS error,
my first recommendation is to step through the code to determine which line is causing it, and then to search for any explicit [object
release] calls that reference that object. Comment them out one-by-one to find where you may have gone wrong (and, of course, make sure the object is properly released
later).
If the line doesn't help you figure out
which object(s) is/are causing the problem, start looking through your [object
release] calls, and make sure you aren't releasing objects too many times by accident, or releasing objects you don't own.
This leads to a good general guideline
regarding release in
Objective-C:
If you own an object (allocate or retain it), you release it. If you don't own it (came via convenience method or someone else allocated it), you don't release it.
(Via Memory Management with Objective C / Cocoa / iPhone, which also has some good tips.)
http://stackoverflow.com/questions/468575/iphone-development-exc-bad-access-error-with-no-stack-trace
'아이폰어플개발정보' 카테고리의 다른 글
| 뷰에 백그라운드칼라주기 (0) | 2010/10/12 |
|---|---|
| xib상의 화면컨트롤의 hierachy가 우선이다-UI관련 초보자들이 내밭는 주요한 오류사례 (0) | 2010/10/12 |
| 화면정상적 디스플레이되었는데, 뜨자마자 EXC_BAD_ACCESS발생시 (1) | 2010/10/12 |
| UIElements guideline (0) | 2010/10/12 |
| customcell사용시 메모리효율적이용, 즉 재사용시키려면 해야할 것. (0) | 2010/10/12 |
| cancel alert (0) | 2010/10/12 |