Skip to content

Commit bc7191f

Browse files
committed
📝 Linting & adding documentation
1 parent 6bf471c commit bc7191f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ios/Classes/InstabugFlutterPlugin.m

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
2929
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[[InstabugFlutterPlugin class] methodSignatureForSelector:method]];
3030
[inv setSelector:method];
3131
[inv setTarget:[InstabugFlutterPlugin class]];
32-
int index = 2;
33-
NSDictionary *myDict = call.arguments;
34-
for(id key in myDict) {
35-
NSObject *arg = [myDict objectForKey:key];
32+
/*
33+
* Indices 0 and 1 indicate the hidden arguments self and _cmd,
34+
* respectively; you should set these values directly with the target and selector properties.
35+
* Use indices 2 and greater for the arguments normally passed in a message.
36+
*/
37+
NSInteger index = 2;
38+
NSDictionary *argumentsDictionary = call.arguments;
39+
for (id key in argumentsDictionary) {
40+
NSObject *arg = [argumentsDictionary objectForKey:key];
3641
[inv setArgument:&(arg) atIndex:index];
3742
index++;
3843
}

0 commit comments

Comments
 (0)