dongyu1614 2017-03-11 05:47
浏览 128
已采纳

golang移动访问文件系统

How can i access the device system in gomobile?

Is there a way to interact with the native libs?

Like this:

package xy

import(
  "Foundation"// ios libraray
)

// Do some stuff with the Foundation package
func Test(){

}
  • 写回答

1条回答 默认 最新

  • douzong2206 2017-03-12 07:39
    关注

    Yes. Take a look at Reverse Bindings here; https://godoc.org/golang.org/x/mobile/cmd/gobind

    To summarise, you import the Android/ObjectiveC library and are good to go.

    The example they give;

    import "ObjC/Foundation/NSDate d := NSDate.Date()

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?