2010-11-22 6 views
3

UITableViewController 클래스에서 상속받은 세 개의보기가 있습니다. 첫 번째는 위치 목록을 표시하고 두 번째보기는 첫 번째보기에서 선택한 행의 위치를 ​​나타내는 주석이있는지도를 보여 주며 마지막 것은 위치 (주소, 이미지, ...)에 대한 정보를 보여줍니다. 뒤로 단추를 두 번째보기로 밀어 넣을 때가끔이 오류 메시지가 나타납니다.'NSInvalidArgumentException', 이유 : '- [NSArrayI leftCapWidth]

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI leftCapWidth]: unrecognized selector sent to instance 0x6b57110' 
*** Call stack at first throw: 
(
0 CoreFoundation      0x02576919 __exceptionPreprocess + 185 
1 libobjc.A.dylib      0x026c45de objc_exception_throw + 47 
2 CoreFoundation      0x0257842b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
3 CoreFoundation      0x024e8116 ___forwarding___ + 966 
4 CoreFoundation      0x024e7cd2 _CF_forwarding_prep_0 + 50 
5 UIKit        0x003935b9 -[UIImageView(UIImageViewInternal) _shouldDrawImage:] + 35 
6 UIKit        0x00392f3a -[UIImageView(UIImageViewInternal) _canDrawContent] + 411 
7 UIKit        0x00308f20 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 955 
8 UIKit        0x00308cfc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407 
9 UIKit        0x00308cfc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407 
10 UIKit        0x00308cfc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407 
11 UIKit        0x0031119a -[UIScrollView _didMoveFromWindow:toWindow:] + 71 
12 UIKit        0x00308cfc -[UIView(Internal) _didMoveFromWindow:toWindow:] + 407 
13 UIKit        0x00307b10 -[UIView(Hierarchy) _postMovedFromSuperview:] + 166 
14 UIKit        0x00300a34 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1080 
15 UIKit        0x002fed87 -[UIView(Hierarchy) addSubview:] + 57 
16 UIKit        0x0050a829 -[UINavigationTransitionView transition:fromView:toView:] + 551 
17 UIKit        0x0050a28d -[UINavigationTransitionView transition:toView:] + 56 
18 UIKit        0x00381329 -[UINavigationController _startDeferredTransitionIfNeeded] + 266 
19 UIKit        0x00380fc7 -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:] + 386 
20 UIKit        0x00381141 -[UINavigationController popViewControllerAnimated:] + 57 
21 UIKit        0x003805b6 -[UINavigationController navigationBar:shouldPopItem:] + 148 
22 UIKit        0x00327143 -[UINavigationBar _popNavigationItemWithTransition:] + 116 
23 UIKit        0x0032def3 -[UINavigationBar _handleMouseUpAtPoint:] + 605 
24 UIKit        0x002f42ff -[UIWindow _sendTouchesForEvent:] + 567 
25 UIKit        0x002d61ec -[UIApplication sendEvent:] + 447 
26 UIKit        0x002daac4 _UIApplicationHandleEvent + 7495 
27 GraphicsServices     0x02ddcafa PurpleEventCallback + 1578 
28 CoreFoundation      0x02557dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
29 CoreFoundation      0x024b8737 __CFRunLoopDoSource1 + 215 
30 CoreFoundation      0x024b59c3 __CFRunLoopRun + 979 
31 CoreFoundation      0x024b5280 CFRunLoopRunSpecific + 208 
32 CoreFoundation      0x024b51a1 CFRunLoopRunInMode + 97 
33 GraphicsServices     0x02ddb2c8 GSEventRunModal + 217 
34 GraphicsServices     0x02ddb38d GSEventRun + 115 
35 UIKit        0x002deb58 UIApplicationMain + 1160 
36 TravelGuideTemplate     0x00002730 main + 102 
37 TravelGuideTemplate     0x000026c1 start + 53 
) 
terminate called after throwing an instance of 'NSException' 

왜 나는이 메시지를 듣지 않습니다. 누군가 나를 도울 수 있습니까?

읽어 주셔서 감사합니다.

답변

4

1 $ 메모리 관리 문제입니다. 귀하의 응용 프로그램이 이전에 출시 된 개체에 액세스하려고합니다 생각합니다. 와, NSZombieEnabled라는 변수를 추가 arguments

  • Variables to be set in the environment에서,

    1. 더블
    2. 이 두 번째 탭을 열고 실행 그룹에서 실행을 클릭합니다

      NSZombie을 활성화하고이 오류 메시지를 변경하는 경우 참조 YES의 값을 입력하고 앞에있는 확인란을 선택하여 사용하도록 설정합니다.

    3. 프로그램을 다시 실행하십시오.
    4. ??
    5. 이익
  • +0

    이제이 오류 메시지가 나타납니다. - [UIImage isKindOfClass :] : 메시지가 할당 해제 된 인스턴스 0x6b751a0으로 전송되었습니다. 같은 오류 메시지가 있습니까? –

    +0

    그래서 UIImage를 풀어서는 안되는 곳에서 (자동) UIImage를 해제하고 있습니다. 그 모든 viewWillDisappear를 체크 해보면 viewDidDisAppear 메서드가 해당 릴리즈에 대해 표시됩니다. 분석기로 그 문제를 추적 해 보셨습니까? Build 메뉴에서'Clean all targets'을 사용하고 이후 같은 메뉴에서'Build and analyze'를 실행하십시오. 그리고 그 버그를 발견했다면 NSZombieEnabled 앞에있는 진드기를 제거하는 것을 잊지 마십시오. –

    +0

    정말 고마워요. 지금은 잘 작동한다고 생각합니다. 나는 분석기를 몰랐다. 나는 차례 차례로 autoreleased 인 UIImageView에 삽입 된 이미지를 autoreleasing했다 (너무 많은 autoreleased 객체들, 나는 이것이 에러 일 수 있다는 것을 몰랐다). 이 모든 것은 너무 빠른 목적을 배우기 위해 일어납니다. c. 너 한테 빚 졌어. –

    관련 문제