'ios'에 해당되는 글 2건

  1. 2012.09.21 [iOS] Reachability
  2. 2011.04.10 [iPhone] EXC_BAD_ACCESS 에러 발생 3

[iOS] Reachability

iOS 2012. 9. 21. 12:40


- Reachability

네트워크 상태 체크하는 애플에서 제공하는 공식 클래스


-  적용방법

1. 클래스 다운로드 https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007324

2. Systemconfiguration.framework 추가

3. 필요한 곳에 Reachability.h 헤더파일 import

4. 빌드 오류가 나는 경우(ARC 관련) 프로젝트 타겟 > Build Phases > Compile Sources 에

    Reachability.m의 compile flags에 -fno-objc-arc 라고 저장.

'iOS' 카테고리의 다른 글

[iPhone] EXC_BAD_ACCESS 에러 발생  (3) 2011.04.10
Posted by finewoo
,

코딩중 EXC_BAD_ACCESS 발생하며 시뮬레이터가 튕기는 경우.
Xcode 기본 설정으로는 위 메시지만 출력한다.
하지만 이 메시지만으로는 정확한 에러 위치를 확인하는것이 쉽지 않다. 
Xcode 에서 아래와 같이 설정함으로써  어디서 에러가 발생됬는지 쉽게 알 수 있다.



[인용원문]

NSZombieEnabled is an environment variable which can be helpful to track down the elusive object causing the problem. With the environment variable set, Cocoa will redirect all objectsisa pointer to an NZZombie object once an objects retain count has reached zero. In the future, should you try and send a message to a previously released object, an exception will be raised showing a message similar to the following:

Setting NSZombieEnabled Environment Variable

In the Groups and Files section, expand the Executables section and right click on your app name and choose Get Info from the dialog:

Select the Arguments tab on the top and then add a new entry in the Variables to be set in the environment section. Name the new variable to NSZombieEnabled and set its value toYES.

Tracking Down the Error

Using a zombie, messages sent to an object that has already released will now generate the exception shown above, and following the stack track should now help you find the location of the object that is generating the EXC_BAD_ACCESS error.

Don’t forget to remove the environment variable, or at a minimum untick the checkbox once you find the source of the problem. 


[출처] http://iphonedevelopertips.com/debugging/tracking-down-exc_bad_access-errors-with-nszombieenabled.html 
 

'iOS' 카테고리의 다른 글

[iOS] Reachability  (0) 2012.09.21
Posted by finewoo
,