私は 4 時間の間に頭がおかしくなり、本当に助けが必要です。コードは次のとおりです。
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//check if strGroup has prefix and suffix #
BOOL result;
result = [strGroup hasPrefix: @"#"];
if (result)
{
result = [strGroup hasSuffix: @"#"];
if (result)
{
NSMutableString* string = [NSMutableString stringWithString: strGroup];
str = [strGroup substringWithRange: NSMakeRange (1, [string length]-2)];
strToHoldAllContact = [NSString stringWithFormat:@"%@",str];
}
}
NSLog(@"strToHoldAllContact=%@",strToHoldAllContact);
}
の値をstrToHoldAllContact
正しく取得しています。しかし、strToHoldAllContact
別のメソッドからアクセスしようとすると、次のエラーが発生します。
[CFString respondsToSelector:]: message sent to deallocated instance 0x856f2a0