RackSpace API を使用して認証し、ASIHttp ライブラリを使用して Auth-Token を取得しようとしていますが、私の問題は、正しく動作することもありますが、ほとんどの場合、このクラッシュが発生しています
libobjc.A.dylib`objc_release:
0x16cd090: pushl %ebp
0x16cd091: movl %esp, %ebp
0x16cd093: subl $8, %esp
0x16cd096: calll 0x16cd09b ; objc_release + 11
0x16cd09b: popl %ecx
0x16cd09c: movl 8(%ebp), %eax
0x16cd09f: testl %eax, %eax
0x16cd0a1: je 0x16cd0d5 ; objc_release + 69
0x16cd0a3: movl (%eax), %edx
0x16cd0a5: movl 16(%edx), %edx
0x16cd0a8: andl $-4, %edx
0x16cd0ab: testb $2, 2(%edx)
0x16cd0af: je 0x16cd0c5 ; objc_release + 53
0x16cd0b1: movl 1002149(%ecx), %ecx
0x16cd0b7: movl %ecx, 4(%esp)
0x16cd0bb: movl %eax, (%esp)
0x16cd0be: calll 0x16cc08c ; objc_msgSend
0x16cd0c3: jmp 0x16cd0d5 ; objc_release + 69
0x16cd0c5: movl %eax, (%esp)
0x16cd0c8: movl $0, 4(%esp)
0x16cd0d0: calll 0x16ce9d0 ; -[NSObject release]
0x16cd0d5: addl $8, %esp
0x16cd0d8: popl %ebp
0x16cd0d9: ret
実際に何がうまくいかないのか理解できません。この問題を解決するのを手伝ってください。
編集 :
これが私が使用しているコードです
+ (void)authenticate
{
[accessDetailsLock lock];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:RACSPACE_AUTHENTICATE_API]];
[request addRequestHeader:@"Content-type" value:@"application/json"];
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
[dic setObject:RACSPACE_USER_NAME forKey:@"username"];
[dic setObject:RACSPACE_PASSWORD forKey:@"apiKey"];
NSMutableDictionary *dic1 = [[NSMutableDictionary alloc] init];
[dic1 setObject:dic forKey:@"RAX-KSKEY:apiKeyCredentials"];
NSMutableDictionary *finalDic = [[NSMutableDictionary alloc] init];
[finalDic setObject:dic1 forKey:@"auth"];
SBJSON *sbJson= [[SBJSON alloc] init];
NSString *strJson =[sbJson stringWithObject:finalDic];
NSLog(@"%@",strJson);
[request setPostBody:(NSMutableData*)[strJson dataUsingEncoding:NSUTF8StringEncoding]];
[strJson release];
[dic release];
[dic1 release];
[finalDic release];
[request startSynchronous];
if (![request error])
{
NSDictionary *responseHeaders = [request responseHeaders];
NSLog(@"Response%@",[responseHeaders description]);
NSLog(@"Response 2=%@",[request responseString]);
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *jsonObject = [[parser objectWithString:[request responseString]] objectForKey:@"access"];
[parser release];
authToken = [[jsonObject objectForKey:@"token"] objectForKey:@"id"];
NSArray *services = [jsonObject objectForKey:@"serviceCatalog"];
for (NSDictionary *service in services)
{
if ([[service valueForKey:@"type"] isEqualToString:@"object-store"])
{
if ([[service valueForKey:@"name"] isEqualToString:@"cloudFiles"])
{
NSDictionary *endpoint = [[service valueForKey:@"endpoints"] objectAtIndex:0];
storageURL = [NSURL URLWithString:[endpoint valueForKey:@"publicURL"]];
}
}
else if([[service valueForKey:@"type"] isEqualToString:@"rax:object-cdn"])
{
if ([[service valueForKey:@"name"] isEqualToString:@"cloudFilesCDN"])
{
NSDictionary *endpoint = [[service valueForKey:@"endpoints"] objectAtIndex:0];
cdnManagementURL = [NSURL URLWithString:[endpoint valueForKey:@"publicURL"]];
}
}
}
[request release];
[accessDetailsLock unlock];
}
}