Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added +responseWithPosts:.

  • Loading branch information...
commit c5d1b25b5dd87a2cc9ac57ac57ec1e7eb9ad15a8 1 parent 207be2d
@isutton authored
Showing with 7 additions and 2 deletions.
  1. +1 −2  TKPostsRequest.m
  2. +1 −0  TKPostsResponse.h
  3. +5 −0 TKPostsResponse.m
View
3  TKPostsRequest.m
@@ -80,8 +80,7 @@ - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string;
- (void)parserDidEndDocument:(NSXMLParser *)parser;
{
[_currentPost release]; _currentPost = nil;
- TKPostsResponse *response = [[[TKPostsResponse alloc] initWithPosts:_receivedPosts] autorelease];
- [self.delegate postsRequest:self didReceiveResponse:response];
+ [self.delegate postsRequest:self didReceiveResponse:[TKPostsResponse responseWithPosts:_receivedPosts]];
}
#pragma mark - TKRequest
View
1  TKPostsResponse.h
@@ -26,6 +26,7 @@
#pragma mark - API
++ (id)responseWithPosts:(NSArray *)posts;
- (id)initWithPosts:(NSArray *)posts;
@end
View
5 TKPostsResponse.m
@@ -36,6 +36,11 @@ - (void)dealloc;
#pragma mark - API
++ (id)responseWithPosts:(NSArray *)posts;
+{
+ return [[[self alloc] initWithPosts:posts] autorelease];
+}
+
- (id)initWithPosts:(NSArray *)posts;
{
if (!(self = [self init]))
Please sign in to comment.
Something went wrong with that request. Please try again.