NSImage cocoa オブジェクトの base64 文字列表現を作成する必要があります。これを処理する最善の方法は何ですか。アップルのドキュメントは、この件に関して少し不足しているようです (または、私はそれを見つけることができません)。Base64 エンコーディングは、外から見るとかなり複雑に見えます。
どんな助けでも大歓迎です。
乾杯アレックス
編集
NSArray *keys = [NSArray arrayWithObject:@"NSImageCompressionFactor"];
NSArray *objects = [NSArray arrayWithObject:@"1.0"];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
NSImage *image = [[NSImage alloc] initWithContentsOfFile:[imageField stringValue]];
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithData:[image TIFFRepresentation]];
NSData *tiff_data = [imageRep representationUsingType:NSPNGFileType properties:dictionary];
NSString *base64 = [tiff_data encodeBase64WithNewlines:NO];