macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

acceptsFirstResponder

テキストフィールドが編集可能で選択可能かを返します

解説

テキストフィールドが編集可能で選択可能かを返します。
編集可能で選択可能ならYESを返します。
片方のみ可能の場合はNOを返します。
両方不可の場合はNOを返します。

返り値

( BOOL )

YES/NO

引数

フレームワーク

ApplicationKit

クラス

NSTextField

Instance Methods

使用可能

10.0

参照

例文

[myOutlet setSelectable: YES];
[myOutlet setEditable: YES];

if ([myOutlet acceptsFirstResponder]){
[myOutlet setStringValue : @"YES"];
}
else{
[myOutlet setStringValue : @"NO"];
}