0
スレッド内でクラス変数を使用してEXC_BAS_ACCESSを取得しようとしています。 コードスニペット:実装でObjective-Cスレッドのパラメータ
@interface ViewController : UIViewController {
NSString* accountLoginName;
NSString* accountPassword;
}
を:
accountLoginName = [NSString stringWithString:textFieldLoginName.text];
accountPassword = [NSString stringWithString:textFieldPassword.text];
[self performSelectorInBackground:@selector(loginAtBackgroundSelector:) withObject:nil];
-(void)loginAtBackgroundSelector:(UIAlertView*)alert
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"%@\n%@", accountLoginName, accountPassword);
[self login];
[self dismissAlert:alert];
[pool release];
}
はちょうどコンソールに書き込もうとコードのこの部分でエラーを取得しますが、loginAtBackgroundSelectorの誤差が随時表示されます。
-(AlertType)login
{
NSLog(@"%@\n%@", accountLoginName, accountPassword);
}
それはトリックでした:)神、私は愚かです:D – user1098429