macOS/iOS API解説

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

目次

stringListForKey:inTable:

テーブルで、キーと関連する配列を返します、なければnilを返します
-(NSArray *)stringListForKey:(NSString *)key:
             inTable:(NSString *)table:

解説

テーブルで、キーと関連する配列を返します。なければnilを返します。
【table】プリンタ情報テーブル
● PPD プリンタ記述ファイル
● PPDOptionTranslation オプション
● PPDArgumentTranslation 引数
● PPDOrderDependency *OrderDependency値
● PPDUIConstraints *UIConstraint値

返り値

( NSArray * )

配列

引数

( NSString * )key

キー

( NSString * )table

テーブル

フレームワーク

ApplicationKit

クラス

NSPrinter

Instance Methods

使用可能

10.0

参照

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
//プリンタ
NSPrinter *prn = [NSPrinter printerWithName:@"MICROLINE 3050c"];

//PPDにPageSizeというキーがあったら処理する
if ([prn isKey:@"PageSize" inTable:@"PPD"]){
        
        NSLog([[prn stringListForKey:@"PageSize" inTable:@"PPD"] description]);
        }else{
        NSLog(@"NO");
        }
}

@end