請溫柔!我只對我正在做的事情有一個模糊的理解。UIDocumentInteractionController中的「表達結果未使用」
我試圖設置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;
我失去了我的腦海裏想了明白這一個。任何援助表示讚賞。
刪除@「%@」, – 2012-03-08 19:42:44