穏やかにしてください!私は自分のしていることをあいまいに理解しているだけです。UIDocumentInteractionControllerの "Expression Result Unused"
UIDocumentInteractionControllerのNameプロパティを設定しようとしましたが、別のアプリケーションに送信する前にファイル名を変更したいと考えています。私はこれを達成するために、次を使用しています:
UIDocumentInteractionController *documentController;
NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSURL *soundFileURL = [NSURL fileURLWithPath:[docDir stringByAppendingPathComponent:
[NSString stringWithFormat: @"%@/%@", kDocumentNotesDirectory, currentNote.soundFile]]];
NSString *suffixName = @"";
if (self.mediaGroup.title.length > 10) {
suffixName = [self.mediaGroup.title substringToIndex:10];
}
else {
suffixName = self.mediaGroup.title;
}
NSString *soundFileName = [NSString stringWithFormat:@"%@-%@", suffixName, currentNote.soundFile];
documentController = [UIDocumentInteractionController interactionControllerWithURL:(soundFileURL)];
documentController.delegate = self;
[documentController retain];
documentController.UTI = @"com.microsoft.waveform-audio";
documentController.name = @"%@", soundFileName; //Expression Result Unused error here
[documentController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
私は、この行の「式結果未使用」のエラーを取得しています:
documentController.name = @"%@", soundFileName;
私はこの1つを把握しようとしている私の心を失っています。いかなる援助も感謝します。
documentController.name = @"%@", soundFileName;
@"%@"
がリテラルNSString
ですが、コンパイラはあなたのための任意のフォーマット/交換を行うことはありません。
@ "%@"を削除してください。 –