Re: Elementary NSUserDefaults Question

2016-12-07 Thread Quincey Morris
On Dec 7, 2016, at 16:39 , Charles Srstka wrote: > > when I pass nil to UserDefaults’ set(forKey:) method in Swift 3 […] it ends > up writing an NSNull instead of deleting the key […], since the method on > UserDefaults takes an Any? That sounds right. The case where

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Charles Srstka
> On Dec 7, 2016, at 1:00 PM, Quincey Morris > wrote: > > On Dec 7, 2016, at 08:24 , Charles Jenkins > wrote: >> >> If anyone knows how to play music from the library at a low volume, without >> screwing up

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Jens Alfke
> On Dec 7, 2016, at 11:33 AM, Sean McBride wrote: > > I'm not sure I follow. I don't know hardly anything about audio playback, > but converting between bookmarks/paths/URLs is pretty trivial as they all are > basically different representations of the same concept.

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Sean McBride
On Wed, 7 Dec 2016 11:24:24 -0500, Charles Jenkins said: >Originally I did store bookmarks back when my app allowed users to pick >background music from their music libraries. But I could find no way to >play bookmarked library music at a low background volume, so I abandoned >that and just began

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Quincey Morris
On Dec 7, 2016, at 08:24 , Charles Jenkins wrote: > > If anyone knows how to play music from the library at a low volume, without > screwing up the system volume for other apps, e.g. Music.app, I’d love to > learn it. You can play audio using any volume you want (without any

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Charles Jenkins
Sean, Originally I did store bookmarks back when my app allowed users to pick background music from their music libraries. But I could find no way to play bookmarked library music at a low background volume, so I abandoned that and just began using a .wav file stored with the app’s resources. If

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Charles Jenkins
That makes sense. Thanks, Ken! On Wed, Dec 7, 2016 at 11:00 AM, Ken Thomases wrote: > On Dec 7, 2016, at 9:25 AM, Charles Jenkins wrote: > > > > I may be misusing NSUserDefaults. I want to store the name of a > background > > music file, which may be

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Sean McBride
On Wed, 7 Dec 2016 10:25:46 -0500, Charles Jenkins said: >When the app starts up, we call NSUserDefaults.standard.register( [ “bgm” : > ) to default to the real file name, so the user will hear Charles, It's also best practice not to store file names/paths, but instead to store "bookmarks".

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Ken Thomases
On Dec 7, 2016, at 9:25 AM, Charles Jenkins wrote: > > I may be misusing NSUserDefaults. I want to store the name of a background > music file, which may be nil if the user doesn’t want to hear anything. For > the time being, I have only two settings for my variable >

Elementary NSUserDefaults Question

2016-12-07 Thread Charles Jenkins
I may be misusing NSUserDefaults. I want to store the name of a background music file, which may be nil if the user doesn’t want to hear anything. For the time being, I have only two settings for my variable “currentBackgroundMusicFileName”: either a file that I distribute with the app, or nil.