macOS/iOS API解説

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

目次

systemVersion

システムバージョンを返します

解説

システムバージョンを返します。

返り値

( unsigned int )

整数値

引数

クラス

NSUnarchiver

Instance Methods

使用可能

10.0

参照

例文

- (IBAction)unarchive:(id)sender
{
    //拡張子codeのファイルを選ぶ
    NSArray *fileTypes = [NSArray arrayWithObject:@"code"];
    //オープンパネル設定
    NSOpenPanel *openPanel = [NSOpenPanel openPanel];
    

    //ホームディレクトリで開く
    [openPanel setDirectory:NSHomeDirectory()];
    //
    if ([openPanel runModalForTypes:fileTypes]) {
          
        id aView = (NSView *)[[NSUnarchiver alloc] initForReadingWithData:[NSData dataWithContentsOfFile: [ openPanel filename ] ]];
        NSLog([aView className]);
        NSLog([NSString stringWithFormat:@"%d",[aView systemVersion]]);

    }