Skip to content

Commit

Permalink
Merge pull request #45 from bradfitz/bradfitz/docs
Browse files Browse the repository at this point in the history
objc: fix a few typos and reword some docs into Go style
  • Loading branch information
progrium authored Apr 14, 2021
2 parents b1e02b0 + fec685e commit a7cd2cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
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

0 comments on commit a7cd2cb

Please sign in to comment.