TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | BSD |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
Depends on: | |
ASIHTTPRequest | >= 0 |
TouchJSON | >= 0 |
An Objective-C Library(with examples) for the Posterous 2.0 API
Download PosterousObjC source to your computer
Locate folder "PosterousClient" under "PosterousObjC/Classes". Drag and drop it into your project. A dialog will appear -- make sure "Copy items" is checked, "Recursively create groups for any added folders" radio button is selected, "Reference Type" is "Default" before clicking "Add".
Right click on the "Frameworks" group in your project and select Add > Existing Frameworks. Then locate the following frameworks and add them to the project (if they do not already exist in your application)
Import PosterousClient.h in the header class of the controller that will use this library.
import "PosterousClient.h"
Create an instance of PosterousClient within your method
PosterousClient *client = [[PosterousClient alloc] initWithCredentials:EMAIL
password:PASSWORD
apitoken:APITOKEN];
Call a Posterous Client method within the same method you created an instance of PosterousClient
GetAUsersPrimarySiteCompletionBlock complete = ^(Site *site, NSError *error)
{
if (error)
{
NSLog(@"GetASingleSite error: %@", [error userInfo]);
}
else
{
Site *result = site;
NSString *siteString = [NSString stringWithFormat:@"id: %@\n name: %@\n is_private: %@\n full_hostname: %@\n posts_url: %@\n posts_count: %@\n comment_persmission: %@",
result._id,result.name,
result.is_private,result.full_hostname,result.posts_url,
result.posts_count, result.comment_permission];
NSLog(@"site: %@",siteString);
}
};
PosterousRequest *request = [PosterousRequest alloc];
[client GetAUsersPrimarySite:request completionBlock:complete];