Macアプリ開発初心者です。
nstableview に一連のデータがあり、プログラムによってこのデータを .cs 形式で保存する必要があります。
-(IBAction)exportInvoice:(id)sender
{
AppDelegate *appDelegate = [NSApp delegate];
NSString *tempStr = [NSString stringWithFormat:@"%@", [OrderModel getInitialOrderBITToDisplay:[appDelegate getDBPath]]];
NSArray* commaSeparatedObjects = [tempStr componentsSeparatedByString:@","];
//NSString *commaSeparatedObjects = [tempStr componentsJoinedByString:@","];
NSLog(@"%@",commaSeparatedObjects);
NSSavePanel *pdfSavingDialog = [NSSavePanel savePanel];
[pdfSavingDialog setRequiredFileType:@"csv"];
if ( [pdfSavingDialog runModalForDirectory:nil file:nil] == NSOKButton ) {
// NSData *dataForPDF = [self exportPdfData];
NSData *dataForPDF = [NSKeyedArchiver archivedDataWithRootObject:commaSeparatedObjects];
NSLog(@"%@",dataForPDF);
[dataForPDF writeToFile:[pdfSavingDialog filename] atomically:NO];
}
}
誰でも問題を整理するのを手伝ってもらえますか?