私のアプリがアドレス帳から電話番号を取得して戻ってきたときに、間違って電話番号以外のものを取得した場合、try catch finalのコードは任意のアイデアを事前に評価され、それをキャッチしません:try catch stop finalは例外をキャッチしていません
*** -[CFDictionary length]: message sent to deallocated instance 0x6a4db70
コード:
strContact = (NSString *)phone; CFRelease(phone);
// NSLog(@"%@", strContact);
CFRelease(multi);
name = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
NSRegularExpression *regex = [[[NSRegularExpression alloc] initWithPattern:@"[a-zA-Z]" options:0 error:NULL] autorelease];
// Assuming you have some NSString myString.
NSUInteger matches = [regex numberOfMatchesInString:strContact options:0 range:NSMakeRange(0, [strContact length])];
質問に**コード**を入れてください – PresleyDias
多くの間違いをしないでください。 –
別のcatchブロックが最初にキャッチしていますか? – user1118321