From e5344035bfed7e9c170a9f493fb320b1ba2a385a Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Tue, 2 Aug 2016 09:49:08 -0700 Subject: [PATCH] pr feedback --- react-native/ios/RealmReact/RealmReact.mm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/react-native/ios/RealmReact/RealmReact.mm b/react-native/ios/RealmReact/RealmReact.mm index 533039a0..9ffcdd99 100644 --- a/react-native/ios/RealmReact/RealmReact.mm +++ b/react-native/ios/RealmReact/RealmReact.mm @@ -56,17 +56,13 @@ extern "C" JSGlobalContextRef RealmReactGetJSGlobalContextForExecutor(id executo id rctJSContext = object_getIvar(executor, contextIvar); if (!rctJSContext && create) { Class RCTJavaScriptContext = NSClassFromString(@"RCTJavaScriptContext"); - - NSMethodSignature *signature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:onThread:)]; - if (signature) { + if ([RCTJavaScriptContext instancesRespondToSelector:@selector(initWithJSContext:onThread:)]) { // for RN 0.28.0+ rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:[JSContext new] onThread:[NSThread currentThread]]; } else { // for RN < 0.28.0 - NSMethodSignature *oldSignature = [RCTJavaScriptContext instanceMethodSignatureForSelector:@selector(initWithJSContext:)]; - assert(oldSignature); - + assert([RCTJavaScriptContext instancesRespondToSelector:@selector(initWithJSContext:)]); rctJSContext = [[RCTJavaScriptContext alloc] initWithJSContext:[JSContext new]]; }