macOS/iOS API解説

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

目次

allowsNaturalLanguage

日付フォーマッタが、自然言語を変換するかを返します

解説

日付フォーマッタが、自然言語を変換するかを返します。
YESであればMayやJunなどが月の名前として変換してくれます。

返り値

( BOOL )

YES/NO

引数

クラス

NSDateFormatter

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSDateFormatter *dateFormat = [[NSDateFormatter alloc]
    initWithDateFormat:@"%Y.%m.%d " allowNaturalLanguage:YES];
[myOutlet setFormatter:dateFormat];

if ([dateFormat allowsNaturalLanguage]){
        NSLog(@"YES");
    }else{
        NSLog(@"NO");
    }
}

@end