diff --git a/Classes/Framework/FMEngine.h b/Classes/Framework/FMEngine.h index d7b35cb..abd58c8 100644 --- a/Classes/Framework/FMEngine.h +++ b/Classes/Framework/FMEngine.h @@ -33,7 +33,7 @@ - (NSURL *)generateURLFromDictionary:(NSDictionary *)dict; - (void)performMethod:(NSString *)method withTarget:(id)target withParameters:(NSDictionary *)params andAction:(SEL)callback useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod; -- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError *)err; +- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError **)err; @end diff --git a/Classes/Framework/FMEngine.m b/Classes/Framework/FMEngine.m index d48808b..ed452db 100644 --- a/Classes/Framework/FMEngine.m +++ b/Classes/Framework/FMEngine.m @@ -55,9 +55,9 @@ - (void)performMethod:(NSString *)method withTarget:(id)target withParameters:(N request = [NSURLRequest requestWithURL:dataURL]; } else { #ifdef _USE_JSON_ - request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]]; + request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]]; #else - request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]]; + request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]]; #endif [request setHTTPMethod:httpMethod]; [request setHTTPBody:[[self generatePOSTBodyFromDictionary:params] dataUsingEncoding:NSUTF8StringEncoding]]; @@ -74,7 +74,7 @@ - (void)performMethod:(NSString *)method withTarget:(id)target withParameters:(N } -- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError *)err { +- (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)params useSignature:(BOOL)useSig httpMethod:(NSString *)httpMethod error:(NSError **)err { NSString *dataSig; NSMutableURLRequest *request; NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] initWithDictionary:params]; @@ -101,16 +101,16 @@ - (NSData *)dataForMethod:(NSString *)method withParameters:(NSDictionary *)para request = [NSURLRequest requestWithURL:dataURL]; } else { #ifdef _USE_JSON_ - request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]]; + request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[_LASTFM_BASEURL_ stringByAppendingString:@"?format=json"]]]; #else - request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]]; + request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:_LASTFM_BASEURL_]]; #endif [request setHTTPMethod:httpMethod]; [request setHTTPBody:[[self generatePOSTBodyFromDictionary:params] dataUsingEncoding:NSUTF8StringEncoding]]; } - NSData *returnData = [FMEngineURLConnection sendSynchronousRequest:request returningResponse:nil error:&err]; + NSData *returnData = [FMEngineURLConnection sendSynchronousRequest:request returningResponse:nil error:err]; return returnData; }