"Save Data" to app resources?

How do I create an app that can save to and read from a settings .txt file within the app’s package contents? I figure this is a god way to make preferences for the app. Is this possible?

It would be better to put the settings .txt file in ~/Library/Application Support/com.you.yourAppName/. Modifying the app bundle can lead to problems.