Skip to content

Commit

Permalink
Second Commit
Browse files Browse the repository at this point in the history
Change callback type to id
  • Loading branch information
Nuclominus committed Feb 25, 2014
1 parent 9ad9eb5 commit 274ec54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion StartNetwork/NetworkRequest/NetworkRequestClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "CDFileManager.h"

@protocol NetworkRequestDelegate <NSObject>
-(void)requestAnswer:(NSMutableArray*)answer withID:(int)tag;
-(void)requestAnswer:(id)answer withID:(int)tag;

@end

Expand Down
2 changes: 1 addition & 1 deletion StartNetwork/NetworkRequest/NetworkRequestClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)requestStarted:(ASIHTTPRequest *)request{
}

- (void)requestFinished:(ASIHTTPRequest *)request {
NSMutableArray *respone = [NSJSONSerialization JSONObjectWithData:request.responseData options:NSJSONReadingMutableContainers error:nil];
id respone = [NSJSONSerialization JSONObjectWithData:request.responseData options:NSJSONReadingMutableContainers error:nil];
if (cash) {
[CDFileManager writeToFile:saveByName arrayToFile:respone];
}
Expand Down
4 changes: 3 additions & 1 deletion StartNetwork/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ - (void)viewDidLoad
// url
requestObject.urlRequest = @"";
// id/tag request need if we have more the one requests
// use some enum
requestObject.idRequest = 1;
requestObject.typeRequest = @"POST";
// some parms if need
[requestObject.paremsRequest setObject:[NSNumber numberWithInt:876] forKey:@""];
// save data to device
requestObject.cashing = YES;
// name by save .plist
requestObject.nameRequest = @"First_Request";

network = [[NetworkRequestClass alloc]init];
Expand All @@ -37,7 +39,7 @@ - (void)viewDidLoad
}

#pragma mark - Network answer
-(void)requestAnswer:(NSMutableArray *)answer withID:(int)tag{
-(void)requestAnswer:(id)answer withID:(int)tag{
NSLog(@"respone %d ===> %@",tag,answer);
}
#pragma mark -
Expand Down

0 comments on commit 274ec54

Please sign in to comment.