2
0
mirror of synced 2025-02-24 07:18:15 +00:00
mobile/bind/testdata/issue12328.objc.m.golden
Elias Naur 60feeb77f4 bind,cmd: support the empty ObjC prefix
Since the Go package name is already prefixed to generated ObjC
names, the empty extra prefix is useful. Support that by not reverting
to the default extra prefix, "Go", if -prefix "" is specified.

To avoid file name clashes with the Go header files, add ".objc" to
the ObjC-facing header names.

Change-Id: I559fe60d7474521617f23894af247c6019ff2a21
Reviewed-on: https://go-review.googlesource.com/33954
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-12-23 09:44:24 +00:00

54 lines
1.1 KiB
Plaintext

// Objective-C API for talking to issue12328 Go package.
// gobind -lang=objc issue12328
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "GoIssue12328.objc.h"
@implementation GoIssue12328T {
}
- (id)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (NSError*)err {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyissue12328_T_Err_Get(refnum);
GoUniverseerror* _r0 = nil;
GoSeqRef* _r0_ref = go_seq_from_refnum(r0);
if (_r0_ref != NULL) {
_r0 = _r0_ref.obj;
if (_r0 == nil) {
_r0 = [[GoUniverseerror alloc] initWithRef:_r0_ref];
}
}
return _r0;
}
- (void)setErr:(NSError*)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t _v;
if ([v conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
_v = go_seq_go_to_refnum(v_proxy._ref);
} else {
_v = go_seq_to_refnum(v);
}
proxyissue12328_T_Err_Set(refnum, _v);
}
@end
__attribute__((constructor)) static void init() {
init_seq();
}