请温柔!我只对我正在做的事情有一个模糊的理解。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