Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: [UIWindow selectedTextRange]: unrecognized selector #9

Open
philippelatulippe opened this issue Nov 26, 2012 · 5 comments
Open

Comments

@philippelatulippe
Copy link

I get a crash when I first load the viewer in my browser:

Hierarchy Viewer[6532:6307] REQUEST HTTP INIT LINE: GET /snapshot?nocache=1353964561487 HTTP/1.1
Hierarchy Viewer[6532:c07] -[UIWindow selectedTextRange]: unrecognized selector sent to instance 0xf36b030
* thread #1: tid = 0x1c03, 0x0341acaa libobjc.A.dylib`objc_exception_throw, stop reason = breakpoint 10.3
    frame #0: 0x0341acaa libobjc.A.dylib`objc_exception_throw
    frame #1: 0x03735cbd CoreFoundation`-[NSObject doesNotRecognizeSelector:] + 253
    frame #2: 0x0369aed0 CoreFoundation`___forwarding___ + 432
    frame #3: 0x0369acb2 CoreFoundation`_CF_forwarding_prep_0 + 50
    frame #4: 0x0268e6a0 UIKit`-[UIView(UITextSelectionAdditions) _caretRect] + 55
    frame #5: 0x02c496cd Foundation`_NSGetRectValueWithMethod + 64
    frame #6: 0x02bba831 Foundation`_NSGetUsingKeyValueGetter + 116
    frame #7: 0x02bb9c99 Foundation`-[NSObject(NSKeyValueCoding) valueForKey:] + 280
    frame #8: 0x00003e45 My Application`+[HVHierarchyScanner classProperties:object:] + 1889 at HVHierarchyScanner.m:198
    frame #9: 0x00005967 My Application`+[HVHierarchyScanner recursivePropertiesScan:] + 2502 at HVHierarchyScanner.m:387
    frame #10: 0x00005f41 My Application`__39+[HVHierarchyScanner hierarchySnapshot]_block_invoke_0 + 288 at HVHierarchyScanner.m:422
    frame #11: 0x0352f8d9 libdispatch.dylib`_dispatch_barrier_sync_f_slow_invoke + 93
    frame #12: 0x03530509 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 353
    frame #13: 0x0366b803 CoreFoundation`__CFRunLoopRun + 2003
    frame #14: 0x0366ad84 CoreFoundation`CFRunLoopRunSpecific + 212
    frame #15: 0x0366ac9b CoreFoundation`CFRunLoopRunInMode + 123
    frame #16: 0x03b117d8 GraphicsServices`GSEventRunModal + 190
    frame #17: 0x03b1188a GraphicsServices`GSEventRun + 103
    frame #18: 0x0229e626 UIKit`UIApplicationMain + 1163
    frame #19: 0x0001cb4d My Application`main + 157 at main.m:17
    frame #20: 0x0001603d My Application`start + 53

Things I have done:

  • Tried versions 1.4.5 and 1.4.6
  • added -ObjC -all_load to my linker flags. (I actually did -ObjC -force_load <path/to/lib.a>, which should do the same thing.)
  • Removed a library that had JSONKit.m

Running on:

  • iPad 5.1 Simulator
  • Mac OS X 10.8.2
  • XCode 4.5.2
  • llvm 4.1

This is a fairly large project with a great deal of static libraries, so if this is not an obvious crash, I can try chopping thing off the project to see if it works.

It would be great if releases were tagged, that way I could try to debug this without having to build the library myself.

@philippelatulippe
Copy link
Author

Ah, it wasn't a crash. I had a breakpoint set for all exceptions. So the bug is that the library sends selectedTextRange to all objects in the hierarchy without first checking if it responds to it.

@hunanboy
Copy link

Thanks mate, I had the same problem. Like you said, removing "all exceptions" breakpoint fix it.

@AndrewLauder
Copy link

I'm having the same problem here, absolutely no breakpoints set, yet it's crashing on me. I'm wondering if it's due to iOS6. I tried w/ older Xcode and 5.1 SDK and had a completely different crash.

@hunanboy
Copy link

hunanboy commented Feb 3, 2013

I ran into same problem. Andrew you are probably right. I just updated Xcode to iOS 6.1 SDK and had this problem. When I used view hierarchy a couple of months ago, it works fine as long as I turn breakpoint off.

@github-xiaogang
Copy link

I have this problem too . any method to solve it without have to turn the breakpoint off ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants