尝试在线程中设置文本时,因“EXC_BAD_ACCESS 在此处崩溃”而崩溃。
???
谢谢
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController<UITextViewDelegate>
{
UITextView *tvCommand;
}
@end
---------
-(void) Thread_Tcp
{
[tvCommand setText:@"HELLO"];//crashes here with EXC_BAD_ACCESS
}
- (void)viewDidLoad
{
NSThread *hThread = [NSThread alloc] initWithTarget:self selector:@selector(Thread_Tcp) object:nil];
[hThread start];
}