Fixed the compiler errors on Mac OS X; now to get it running...

This commit is contained in:
Pietro Gagliardi 2014-03-01 14:05:14 -05:00
parent 00243442d2
commit b6b8ee6a82
2 changed files with 7 additions and 3 deletions

View File

@ -17,13 +17,13 @@ var (
_NSObject_Class = C.object_getClass(_NSObject)
)
func newDelegateClass(name string) (C.Class, error) {
func makeDelegateClass(name string) (C.Class, error) {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
c := C.objc_allocateClassPair(_NSObject_Class, cname, 0)
if c == C.NilClass {
return fmt.Errorf("unable to create Objective-C class %s; reason unknown", name)
return C.NilClass, fmt.Errorf("unable to create Objective-C class %s; reason unknown", name)
}
C.objc_registerClassPair(c)
return c, nil

View File

@ -21,6 +21,10 @@ We will create an Objective-C class goAppDelegate. It contains two methods:
// extern void appDelegate_uitask(id, SEL, id);
import "C"
// temporary for now
func msgBox(string, string){}
func msgBoxError(string, string){}
var uitask chan func()
var mtret chan interface{}
@ -43,7 +47,7 @@ func ui(initDone chan error) {
mtret = make(chan interface{})
go mainThread()
v := <-mtret
if err, ok := v.(error); err {
if err, ok := v.(error); ok {
initDone <- fmt.Errorf("error initializing Cocoa: %v", err)
return
}