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

objc: fix a few typos and reword some docs into Go style #45

Merged
merged 1 commit into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion objc/class.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func NewClassFromStruct(value interface{}) Class {
return object{ptr: uintptr(ptr)}
}

// Lookup a Class by name
// Get looks up a class by name.
func Get(name string) Class {
return object{ptr: uintptr(C.GoObjc_GetClassByName(C.CString(name)))}
}
Expand Down
15 changes: 7 additions & 8 deletions objc/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
// Package objc implements access to the Objective-C runtime from Go
package objc

import (
"C"
"unsafe"
)
import "C"

import (
"fmt"
"strings"
"unsafe"
)

// An Object represents an Objective-C object, along with
// some convenience methods only found on NSObjects.
type Object interface {
// SendMsg sends an arbitrary message to the method on the
// object that is idenfieid by selectorName.
// object that is identified by selectorName.
Send(selector string, args ...interface{}) Object

// SendSuperMsg is like SendMsg, but sends to the object's
Expand All @@ -41,7 +40,7 @@ type Object interface {
// Release sends the "release" message to the object.
Release() Object

// AutoRelease sends the "autorelease" message to the object.
// Autorelease sends the "autorelease" message to the object.
Autorelease() Object

// Copy sends the "copy" message to the object.
Expand Down Expand Up @@ -76,7 +75,7 @@ type Object interface {
}

// Type object is the package's internal representation of an Object.
// Besides implementing the Objct interface, object also implements
// Besides implementing the Object interface, object also implements
// the Class interface.
type object struct {
ptr uintptr
Expand All @@ -86,7 +85,7 @@ func ObjectPtr(ptr uintptr) Object {
return object{ptr: ptr}
}

// Return the Object as a uintptr.
// Pointer returns the object as a uintptr.
//
// Using package unsafe, this uintptr can further
// be converted to an unsafe.Pointer.
Expand Down