pkg/objc: properties

This commit is contained in:
Mitchell Hashimoto
2022-10-25 21:25:07 -07:00
parent aaaae38fa1
commit 59cb774cdd
5 changed files with 84 additions and 6 deletions

View File

@@ -8,3 +8,13 @@ pub const Object = struct {
pub usingnamespace MsgSend(Object);
};
test {
const testing = std.testing;
const NSObject = objc.Class.getClass("NSObject").?;
// Should work with our wrappers
const obj = NSObject.msgSend(objc.Object, objc.Sel.registerName("alloc"), .{});
try testing.expect(obj.value != null);
obj.msgSend(void, objc.sel("dealloc"), .{});
}