From 6ca4b6f083be64f4c4620666c10896e2080b1494 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 13 Jul 2011 06:09:34 -0500 Subject: [PATCH] updated README with code blocks --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0b04c53..742a1ae 100644 --- a/README.md +++ b/README.md @@ -3,37 +3,38 @@ An Objective-C Library(with examples) for the Posterous 2.0 API 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 @@ -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); } };