SPConnector 0.8

SPConnector 0.8

测试测试过
语言语言 Obj-CObjective C
许可协议 MIT
发布上次发布2014年12月

Nathan Wood 维护。



  • Nathan Wood

描述

SPConnector 设计为在保持轻量化的同时提供 SharePoint 功能。

它本身不处理网络连接,并旨在在这个方面提供灵活性。

未来还将提供更多 SharePoint 操作。

入门

  1. 将 SPConnector 文件夹复制到项目中
  2. 将 /usr/include/libxml2 添加到 '头文件搜索路径'
  3. 将 -lxml2 添加到 '其他链接器标志'

示例用法

  1. 将 RequestSubclasses/AFSPURLConnectionOperation 文件复制到项目
NSURL *url = [NSURL URLWithString:@"http://sharepoint.example.com/"];
NSURLCredential *credential = [credentialWithUser:@"username"
                                         password:@"password"
                                      persistence:NSURLCredentialPersistenceNone];
self.ctx = [[SPContext alloc] initWithSiteURL:url];
[self.ctx setRequestSetupBlock:^(SPURLConnectionOperation *requestOperation) {
    // Called when a new request is allocated
    [requestOperation setAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {
        [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
    }];
}];

[self.ctx getListCollection:^(NSArray *lists, NSError *error) {
    for (SPList *list in lists) {
        NSLog(@"%@", list.title);
    }
}];

许可协议

SPConnector 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。