In ClassA.h
@interface ClassA : NSObject<RKObjectLoaderDelegate,RKRequestDelegate>
@property(nonatomic,strong)NSMutableDictionary *inputDict;
ClassA.m
//After Implementation
@synthesize inputDict;
-(void)sendRequestWithInputDict:(NSMutableDictionary*)inputDictVal
{
RKURL *baseURL = [RKURL URLWithBaseURLString:baseUrl];
RKObjectManager * manager = [RKObjectManager objectManagerWithBaseURL:baseURL];
[manager setClient:[RKClient sharedClient]];
manager.client.requestQueue.showsNetworkActivityIndicatorWhenBusy = YES;
RKObjectLoader *objectLoader = [manager loaderWithResourcePath:@"/getLocation"];
objectLoader.serializationMIMEType = RKMIMETypeJSON;
objectLoader.method = RKRequestMethodPOST;
objectLoader.params = inputDictVal;
objectLoader.delegate = self;
[objectLoader send];
}
-(void)getLocation
{
inputDict = [[NSMutableDictionary alloc]init];
[self sendRequest:inputDict];
}
baseUrl 在我在这里导入的常量文件中声明。我正在尝试从另一个类调用 sendRequest 函数。但是我在 requestWillPrepareForSend(RKRequest.m) 中得到一个 EX_BAD_ACCESS。
我认为某些对象会自动释放。我不知道是哪一个...