[gomobile] Unclear error message when gomobile generated .framework in iOS

249 views
Skip to first unread message

Gaurav Menghani

unread,
Aug 30, 2015, 6:53:37 AM8/30/15
to golang-nuts
Hi,

I am trying to use the gomobile generated .framework in iOS. My code
is here at: https://github.com/reddragon/eclisp/tree/master/lang.

When I try to call a method on an instance of the generated ObjC
struct (GoLangLangEnv), I get the following error:
"'NSInternalInconsistencyException', reason: 'go_seq_writeRef on
objective-c objects is not permitted'"

It is unclear to me as to how to fix this error. I grep-ped the repo
for the existence of the string, it last existed here:
https://github.com/golang/mobile/blob/926122382b51dbfb6ccd7685b89f3a6e17cd834f/bind/objc/seq_darwin.m#L383,
but it seems that it has been removed since then.

Updating my gomobile checkout, rebuilding gomobile and generating the
.framework again, still gives me the same error. Can someone point out
what am I doing wrong? Here is the code I could be doing wrong? Here
is the snippet of the small amount of code I wrote:
http://pastebin.com/XKWgf0ne

Thanks!
--
Gaurav Menghani

Hyang-Ah Hana Kim

unread,
Sep 2, 2015, 9:04:58 PM9/2/15
to Gaurav Menghani, golang-nuts
Hello,

The LangEnv has to be allocated from the Go side.

Instead of [GoLangLangEnv alloc], create a go function that returns *LangEnv 
and let the objective-c side call the function to get the GoLangLangEnv instance.


- Hana


--
Gaurav Menghani

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
__

Gaurav Menghani

unread,
Sep 7, 2015, 2:49:26 AM9/7/15
to Hyang-Ah Hana Kim, golang-nuts
Thanks a lot Hana!

That works!
--
Gaurav Menghani
Reply all
Reply to author
Forward
0 new messages