Skip to content

Commit

Permalink
updated README with code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgrenon committed Jul 13, 2011
1 parent 4c0fca2 commit 6ca4b6f
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions README.md
Expand Up @@ -3,37 +3,38 @@ An Objective-C Library(with examples) for the Posterous 2.0 API

<img src="https://github.com/joshgrenon/PosterousObjC/raw/master/screenshot.png" alt="screenshot" />

#How to import PosterousObjC into your project:
#How to import PosterousObjC into your project

1. Download PosterousObjC source to your computer

2. 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".

3. 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)
CFNetwork
SystemConfiguration
MobileCoreServices
CoreGraphics
libz.1.2.3.dylib
- CFNetwork
- SystemConfiguration
- MobileCoreServices
- CoreGraphics
- libz.1.2.3.dylib


#Calling PosterousObjC methods in your project:
#Calling PosterousObjC methods in your project

1. Import PosterousClient.h in the header class of the controller that will use this library.

```#import "PosterousClient.h"```
#import "PosterousClient.h"```

3. Create an instance of PosterousClient within your method
2. Create an instance of PosterousClient within your method

GetAUsersPrimarySite example code
//Note: You will need to set EMAIL, PASSWORD, APITOKEN (located at the top of the PosterousClient.h) to your Posterous email, password, and apitoken before using this library in your project.

```PosterousClient *client = [[PosterousClient alloc] initWithCredentials:EMAIL
Note: You will need to set EMAIL, PASSWORD, APITOKEN (located at the top of the PosterousClient.h) to your Posterous email, password, and apitoken before using this library in your project.

PosterousClient *client = [[PosterousClient alloc] initWithCredentials:EMAIL
password:PASSWORD
apitoken:APITOKEN];```


4. Call a Posterous Client method within the same method you created an instance of PosterousClient:
3. Call a Posterous Client method within the same method you created an instance of PosterousClient:

GetAUsersPrimarySite example code

Expand All @@ -47,12 +48,12 @@ GetAUsersPrimarySite example code
{
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: %@",
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);
NSLog(@"site: %@",siteString);
}
};

Expand Down

0 comments on commit 6ca4b6f

Please sign in to comment.