我使用此函数来保存MyFile.caf
NSString *nomeFile = self.nomeBastard.text;
NSString *tempDir = NSTemporaryDirectory();
NSString *soundFilePath = [tempDir stringByAppendingString:[NSString stringWithFormat:@"%@.caf", nomeFile]];//@"sound.caf"];
NSString *outputSoundFilePath = [tempDir stringByAppendingString:[NSString stringWithFormat:@"%@0.caf", nomeFile]];//@"soundO.caf"];
soundFileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
outputSoundFileURL = [[NSURL alloc] initFileURLWithPath: outputSoundFilePath];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
我的nomeBastard.text
有一个默认值(写下你的名字并按REC),但在保存的文件上该值不会改变,我总是保存一个文件.caf,第一个值就像:
写下您的名字并按 REC.caf
如何从我的 UITextField
获取名称?
首先在我的屏幕上更改文本字段 isert MyFileName 上的值
Rec应用程序上的Whet TAP不使用名称注册文件,而是注册0.caf
最佳答案
我想你想重置值并设置 placeHolder :
self.yourTextField.text = @"";
self.yourTextField.placeHolder = @"write your name and press REC";
保存 .caf 后应用此代码
如果您想用一些文本更改文本字段:
self.yourTextField.text = @"Place Some Text Here";
关于ios - 使用 UITextField 保存文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19385546/