Operating System
What feature would you like to be added?
objc.Send[[]objc.ID](obj, sel) should return a []objc.ID when the Objective-C method returns NSArray*. Currently it panics with "purego: unsupported return kind: slice".
Why is this needed?
Many Foundation APIs return NSArray* (NSProcessInfo.arguments, NSDictionary.allKeys, NSString.componentsSeparatedByString:, etc.). Today you have to manually iterate:
array := obj.Send(sel)
count := objc.Send[uint](array, sel_count)
result := make([]objc.ID, count)
for i := uint(0); i < count; i++ {
result[i] = objc.Send[objc.ID](array, sel_objectAtIndex, i)
}
The natural Go spelling should just work:
args := objc.Send[[]objc.ID](processInfo, sel_arguments)