Removed objc_new(). The idea is to remove all the objc_* functions that aren't prefixed with C. (except objc_getClass()).
This commit is contained in:
parent
1a7bf4cd89
commit
3a130b756a
|
@ -64,7 +64,7 @@ func mkAppDelegate() error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("error adding NSApplication delegate buttonClicked: method (to handle button clicks): %v", err)
|
||||
}
|
||||
appDelegate = objc_new(objc_getClass(_goAppDelegate))
|
||||
appDelegate = C.objc_msgSend_noargs(objc_getClass(_goAppDelegate), _new)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ func _msgBox(primarytext string, secondarytext string, style uintptr, button0 st
|
|||
ret := make(chan struct{})
|
||||
defer close(ret)
|
||||
uitask <- func() {
|
||||
box := objc_new(_NSAlert)
|
||||
box := C.objc_msgSend_noargs(_NSAlert, _new)
|
||||
C.objc_msgSend_id(box, _setMessageText, toNSString(primarytext))
|
||||
C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext))
|
||||
objc_msgSend_uint(box, _setAlertStyle, style)
|
||||
|
|
|
@ -85,7 +85,7 @@ var (
|
|||
)
|
||||
|
||||
func newListboxArray() C.id {
|
||||
array := objc_new(_NSArrayController)
|
||||
array := C.objc_msgSend_noargs(_NSArrayController, _new)
|
||||
C.objc_msgSend_bool(array, _setAutomaticallyRearrangesObjects, C.BOOL(C.NO))
|
||||
return array
|
||||
}
|
||||
|
|
|
@ -43,10 +43,6 @@ func objc_alloc(class C.id) C.id {
|
|||
return C.objc_msgSend_noargs(class, _alloc)
|
||||
}
|
||||
|
||||
func objc_new(class C.id) C.id {
|
||||
return C.objc_msgSend_noargs(class, _new)
|
||||
}
|
||||
|
||||
func objc_release(obj C.id) {
|
||||
C.objc_msgSend_noargs(obj, _release)
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ func ui(main func()) error {
|
|||
go func() {
|
||||
for f := range uitask {
|
||||
// we need to make an NSAutoreleasePool, otherwise we get leak warnings on stderr
|
||||
pool := objc_new(_NSAutoreleasePool)
|
||||
pool := C.objc_msgSend_noargs(_NSAutoreleasePool, _new)
|
||||
fp := C.objc_msgSend_ptr(_NSValue, _valueWithPointer,
|
||||
unsafe.Pointer(&f))
|
||||
C.objc_msgSend_sel_id_bool(
|
||||
|
|
Loading…
Reference in New Issue