Ios 如何将变量从颤振传递到本机目标c

Ios 如何将变量从颤振传递到本机目标c,ios,objective-c,flutter,Ios,Objective C,Flutter,我发现了大量关于使用method channel将数据从Flatter传递到android的信息,但对于objective c则没有。我理解调用函数,但不理解传递数据。下面是我的一个例子 Future<void> _uploadImage(String filePath) async { try { await platform.invokeMethod('uploadImage', {"filePath": filePath}); } on Plat

我发现了大量关于使用method channel将数据从Flatter传递到android的信息,但对于objective c则没有。我理解调用函数,但不理解传递数据。下面是我的一个例子

  Future<void> _uploadImage(String filePath) async {
    try {
      await platform.invokeMethod('uploadImage', {"filePath": filePath});
    } on PlatformException catch (e) {
      print("Failed to get token: '${e.message}'.");
    }
  }
要澄清的是,用objective-c编写的最底层代码集肯定是不正确的,但我一直在尝试将其拼凑出来。我有图像路径,我正试图上传到Dropbox。主要问题是文件路径没有到达方法通道。NSString*filePath=call.arguments(@“filePath”)不是实际的函数调用。

更改:

NSString *filePath = call.arguments(@"filePath");


除非你知道如何使用Obj C,否则我建议你改用swift。
flatter create-I swift-t插件
。非常感谢你!我一直在寻找类似的东西很多天,尝试不同的解决方案,只是通过你的答案解决了我的问题。
NSString *filePath = call.arguments(@"filePath");
NSString *filePath = call.arguments[@"filePath"];