我想UITextField
在一个线程中获取文本。
IBOutlet UITextField *textSearchBar;
{
NSThread* thread ......init:@selector(test)....
[thread start]
}
-(void)test
{
NSString* str = textSearchBar.text;//here to show '_WebThreadLockFromAnyThread'
}
我知道我可以使用这样的代码来修复它,但我不想用这种方式
{
NSThread* thread ......init:@selector(test)..withObject:textSearchBar.text];....
[thread start]
}
-(void)test:(NSString*)textStr
{
NSString* str = textStr;
}
UITextField
所以任何人都知道没有'_WebThreadLockFromAnyThread'的任何其他方式来获取文本