Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string.
On Dec 13, 2014, at 10:20 AM, Maxthon Chan <m...@maxchan.info> wrote: > This got me scratching my head, hard. Why would class_respondsToSelector() > crash? (BTW this is used in a class search loop so I cannot use [NSObject > respondsToSelector:] just yet.) > > /Users/technix/Developer/Subtitler > Pro/Frameworks/SubtitleKit/SubtitleKitTests/SKSubripParseTest.m:33: error: > -[SKSubripParseTest testFileFormatSearch] : failed: caught > "NSRangeException", "*** -[__NSCFString substringFromIndex:]: Index 18 out of > bounds; string length 17" > ( > 0 CoreFoundation 0x00007fff9266666c > __exceptionPreprocess + 172 > 1 libobjc.A.dylib 0x00007fff8725976e > objc_exception_throw + 43 > 2 CoreFoundation 0x00007fff9266651d > +[NSException raise:format:] + 205 > 3 Foundation 0x00007fff8f127b2e -[NSString > substringFromIndex:] + 118 > 4 AppKit 0x00007fff8a4e1c49 > +[_NSObjectAnimator _targetClass] + 92 > 5 AppKit 0x00007fff8a4e1b79 > +[_NSObjectAnimator resolveInstanceMethod:] + 34 > 6 libobjc.A.dylib 0x00007fff8725c954 > _ZL28_class_resolveInstanceMethodP10objc_classP13objc_selectorP11objc_object > + 80 > 7 libobjc.A.dylib 0x00007fff87262799 > lookUpImpOrForward + 356 > 8 libobjc.A.dylib 0x00007fff87262617 > lookUpImpOrNil + 20 > 9 libobjc.A.dylib 0x00007fff872545ff > class_respondsToSelector + 37 > 10 SubtitleKit 0x00000001000d02c8 +[SKFormat > formatEngineForExtension:] + 184 > 11 SubtitleKitTests 0x000000010008551e > -[SKSubripParseTest testFileFormatSearch] + 142 > 12 CoreFoundation 0x00007fff9253f3cc > __invoking___ + 140 > 13 CoreFoundation 0x00007fff9253f222 > -[NSInvocation invoke] + 290 > 14 XCTest 0x0000000100097919 -[XCTestCase > invokeTest] + 253 > 15 XCTest 0x0000000100097b1a -[XCTestCase > performTest:] + 150 > 16 XCTest 0x00000001000a0700 -[XCTest > run] + 257 > 17 XCTest 0x000000010009682b > -[XCTestSuite performTest:] + 379 > 18 XCTest 0x00000001000a0700 -[XCTest > run] + 257 > 19 XCTest 0x000000010009682b > -[XCTestSuite performTest:] + 379 > 20 XCTest 0x00000001000a0700 -[XCTest > run] + 257 > 21 XCTest 0x000000010009682b > -[XCTestSuite performTest:] + 379 > 22 XCTest 0x00000001000a0700 -[XCTest > run] + 257 > 23 XCTest 0x000000010009383c > __25-[XCTestDriver _runSuite]_block_invoke + 56 > 24 XCTest 0x000000010009f36d > -[XCTestObservationCenter _observeTestExecutionForBlock:] + 162 > 25 XCTest 0x0000000100093770 > -[XCTestDriver _runSuite] + 269 > 26 XCTest 0x0000000100094359 > -[XCTestDriver _checkForTestManager] + 678 > 27 XCTest 0x00000001000a35b0 > +[XCTestProbe runTests:] + 182 > 28 xctest 0x0000000100001256 xctest + 4694 > 29 xctest 0x00000001000015d6 xctest + 5590 > 30 xctest 0x0000000100000ed3 xctest + 3795 > 31 libdyld.dylib 0x00007fff90e315c9 start + 1 > ) > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/phillip.mills1%40acm.org > > This email sent to phillip.mil...@acm.org _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com