开发者

OpenDirectory.framework: connecting to remote servers?

I'm trying to replicate at least some of the functionality of Workgroup Manager using the NSOpenDirectory.h APIs available in 10.6. I can communicate with my local directory just fine but no matter what I try I can't establish a connection to a remote machine. Here's my ODSession and ODNode setup code.

    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:@"remote.server.com", @"kODSessionProxyAddress",
@"username", @"kODSessionProxyUsername",
@"password", @"kODSessionProxyPassword", nil];
ODSession *session = [ODSession sessionWithOptions:options error:&error];
NSLog(@"Node names: %@", [session nodeNamesAndReturnError:&erro开发者_JAVA技巧r]);
ODNode *node = [ODNode nodeWithSession:session type:kODNodeTypeNetwork error:&error];

Anyone have experience with this framework or know what I'm doing wrong?


In case anyone is interested, turns out that my issue was the improper use of the kOD constants. They're already string constants and so don't need to be put into strings. Once I realized that I was able to get my sample project working.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜