Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: go_seq_go_to_refnum on objective-c objects is not permitted #20254

Closed
karalabe opened this issue May 5, 2017 · 6 comments

Comments

Projects
None yet
7 participants
@karalabe
Copy link
Contributor

commented May 5, 2017

We've received a bug report that recently (2+ weeks at least) iOS builds have been erroring out with a strange error. Any ideas about it?

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'go_seq_go_to_refnum on objective-c objects is not permitted'

@gopherbot gopherbot added this to the Unreleased milestone May 5, 2017

@sashabaranov

This comment has been minimized.

Copy link

commented May 11, 2017

Also experiencing this.

Happens to me when I manually instantiate golang's struct and then perform some actions with its internals.

MygolangObject* obj = [[MygolangObject alloc] init];
[obj setProperty:value]; // fails here

However it works if I introduce procedure to create objects in golang:

MygolangObject* obj = MygolangFunctionToCreateObject(property_value);
[obj setProperty:value]; // works!
@ArEnSc

This comment has been minimized.

Copy link

commented Jun 30, 2017

I don’t understand how this works can you clearify ? With a full example ?

@zgramana

This comment has been minimized.

Copy link

commented Jun 30, 2017

I noticed the error when I implemented the generated class declared by gomobile from my Go interface which included the _ref property. When I declared my own class and implemented the protocol which mapped directly to my Go interface (without _ref) it worked as expected.

@gabriel

This comment has been minimized.

Copy link

commented Jul 11, 2017

You can't use alloc/init to make a go struct.. You have to create a constructor in go code and call that.

No:

MyObject* obj = [[MyObject alloc] init];

Yes:

func NewMyObject() *MyObject {
  return &MyObject{...}
}
MyObject* obj = TheFrameworkNewMyObject();

@bradfitz bradfitz added the mobile label Jul 20, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Jul 29, 2017

Change https://golang.org/cl/51870 mentions this issue: bind: mark default ObjC initializer unavailable

@gopherbot

This comment has been minimized.

Copy link

commented Jul 30, 2017

Change https://golang.org/cl/52012 mentions this issue: bind: generate ObjC initializers

@golang golang locked and limited conversation to collaborators Aug 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.