Je rencontre une erreur lors de la tentative de transfert de données vers la méthode Obj-C.React-Native Erreur: [__NSPlaceholderDictionary initWithObjects: forKeys: count:]: tentative d'insertion d'objet nil à partir d'objets [0] '
code comme indiqué, Obj-C:
RCT_EXPORT_METHOD(connect:(NSDictionary *) params) {
_connection = [_phone connect:params delegate:self];
}
js:
Twilio.connect({To: '+447842111281'});
Le problème vient de la manipulation du NSDictionary, mais je ne peux pas voir les données d'un problème. N'importe quelles idées seraient appréciées.
La trace de la pile est la suivante:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010d94f34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010c4f921e objc_exception_throw + 48
2 CoreFoundation 0x000000010d865d8f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 351
3 CoreFoundation 0x000000010d865bfb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
4 reactNativeRogChapTwilio 0x000000010b783107 -[TCConnectionInternal provideStats] + 1384
5 reactNativeRogChapTwilio 0x000000010b79fdb9 __21-[TCRTCMonitor start]_block_invoke + 70
6 libdispatch.dylib 0x00000001118e40cd _dispatch_client_callout + 8
7 libdispatch.dylib 0x00000001118c01c3 _dispatch_continuation_pop + 1091
8 libdispatch.dylib 0x00000001118d51e2 _dispatch_source_latch_and_call + 195
9 libdispatch.dylib 0x00000001118cdd7d _dispatch_source_invoke + 1098
10 libdispatch.dylib 0x00000001118c4b2e _dispatch_main_queue_callback_4CF + 1006
11 CoreFoundation 0x000000010d9134f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
12 CoreFoundation 0x000000010d8d8f8d __CFRunLoopRun + 2205
13 CoreFoundation 0x000000010d8d8494 CFRunLoopRunSpecific + 420
14 GraphicsServices 0x00000001132cda6f GSEventRunModal + 161
15 UIKit 0x000000010ff9df34 UIApplicationMain + 159
16 reactNativeRogChapTwilio 0x000000010b77d2ef main + 111
17 libdyld.dylib 0x000000011193068d start + 1
18 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Tout comme les états de message d'erreur, vous essayez de définir nil dans NSDictionary, ce qui est interdit. Définissez un point d'arrêt d'exception, réexécutez et affichez le code qui provoque le blocage. – alexburtnik
Onglet Breakpoints -> Bouton "+" en bas à gauche -> Ajouter un point d'arrêt d'exception – alexburtnik
@alex argc et argv ne sont pas tous deux nuls, et AppDelegate est une classe valide ... – frostfat