0
在正常情況下,一個藍色retangle似乎成爲第一個響應,這樣圖像的NSTextField對象外:
link for Normal CaseNSTextField外的藍色對焦環缺失?
不過,我有一個的NSTextField有沒有外面的藍色邊框。這是爲什麼?
這是它是如何happerns:
1>我創建一個典型的MAC OS應用程序。
2>我通過調用相應視圖的 addSubview:和 removeFromSuperview方法切換應用的子視圖。
3>在一個子視圖(實際上是上面引用的圖像)中,單擊「下一步」按鈕。它的作用是這樣的(在子視圖的控制器.m文件中定義):
- (IBAction)actionNextClicked:(id)sender{
//_hdlThreadNext is a NSThread object
[[_hdlThreadNext alloc] initWithTarget:self [email protected](threadNext:) object:nil];
[_hdlThreadNext start];
}
和線程是這樣的:
- (void)threadNext:(id)sender{
@autoreleasepool{
BOOL success;
[CATransation begin];
/* send username and password and decrypt responce */
... // balabala... and set "success"
if (success){
[[self view] removeFromSuperview];
[self sendMessageToSuperview:@"Add Next View"]; // Superview's method, telling superview to call addSubview: to add another subview
}
else{
/* Nothing special to do */
}
[CATransation commit];
}
}
4>子視圖切換到另一個。它的組合視圖似乎是確定的:image for combo view
但其他NSTextView的藍色邊框不會再出現!
有沒有人知道我做了什麼錯?非常感謝你!