Question

To anyone who can help,

So I confess to not being great with computers or apps. In fact, this is my first experience creating an app, so please be nice with me. The app I am creating is for a school project and needs to be able to record audio and save these recordings. In order to do this, I added "AVFoundationFramework" to the build phases under "Link Binary With Libraries" and attempted to edit AVAudioRecorder.h in the style of what it says to do on the online Developer Tools. I got this error message:

"'AVAudioRecorder.h' is locked for editing and you may not be able to save your changes. Do you want to unlock it? 'AVAudioRecorder.h' is currently locked because you are not the current owner of the file and do not have write permission." And then it gives me the options "Don't Unlock" and "Unlock". Note that I got the latest version of Xcode that I am using in the App Store and never moved it or any of the Xcode files I have worked with to or from any other computers, so this should not be an issue.

When I hit "Unlock", this message displays: "The file 'AVAudioRecorder.h' could not be unlocked. Could not add write permission to the file because you do not own it. Try modifying the permissions of the file in the Finder or Terminal."

I did both of those things - I made sure I have Read & Write permission for the folder its in, and I hit "Apply to Enclosed Items" and that didn't work. I got help from someone better with computers than me and we looked in the Terminal and, according to him, I have permission according to the Terminal. I then took my computer to the Apple Store, where they found AVFoundation as a file in my Hard Drive and gave it Read & Write permission in there, and they did some other things as well that I didn't understand involving permissions. They even re-installed my computer and that didn't help.

So I'm at a loss. I apologize if this has been asked already, but I did look and see if anyone had asked similar questions and gotten any answers other than what I have already tried that hasn't worked. The closest I found was this in response to a very similar question with UIViewController.h where he said:

"This looks like you attempted to edit a header file belonging to a system framework in iOS which are protected against unintentional changes like this, possibly because the assistant editor in Xcode (usually shown in the right-hand editor) showed this header at some point.

The only solution here is to revert your changes unless you know exactly why you are making changes in those files."

Sadly I do not know what this means and can't work from there. So if someone can either explain what the above quote means in simple terms OR how to otherwise fix the problem, that would be amazing.

Was it helpful?

Solution

First off, congrats on your first app! To answer answer your question: don't do this! ;-) You should never edit SDK header files. These warnings are for your own benefit. You can really screw things up otherwise. Not sure what info/documentation you were seeing that made you think that you were supposed to, but that's definitely not the right thing to do. But don't feel bad... this stuff is confusing at first.

I would suggest you find an example app that does recording and playback, compile it in Xcode, and make sure it works on your device. Then study it. See how they did things. Create your own Xcode project and try to recreate what they did. That's probably the best way to approach learning this.

Here's a tutorial showing how to use AVAudioRecorder that you might find helpful. Good luck!

http://www.techotopia.com/index.php/Recording_Audio_on_iOS_7_with_AVAudioRecorder

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top