Calling *static* methods without wrapper instance?

0 views
Skip to first unread message

mh

unread,
Sep 8, 2007, 1:46:09 PM9/8/07
to cocoa-sharp-dev
Hi,

i'm looking into implementing the Cocoa# wrapper for NSUserDefaults,
and 'm running int a snag: calling static/cass methods on the wrapped
class, without having a wrapper instance.

i found that i can call them fine as such:

ObjCMessaging.objc_msgSend(NativeClass.ToIntPtr(),
"standardUserDefaults"

but unfortunately, NativeClass is not static itself, so i cannot
expose StandardUserDefaults as static, on the managed side. this makes
the class awkward to use, as one has to call "def = new
UserDefaults().StandardUserDefaults".

any suggestions, thoughts, workarounds?

(of course i'll happily share the wrapper here and/or in SVN, once
finished)

thanx,

marc hoffman

RemObjects Software
The Infrastructure Company
http://www.remobjects.com

Reply all
Reply to author
Forward
0 new messages