我使用此功能保存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
中获取名字?在这里,我首先在屏幕上更改文本字段MyFileName的值
Rec App上的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/