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を取得します。
一部のオブジェクトは自動的に解放されると思います。どれなのかわからない…