Switch to a new song/audio in background for iOS

If you have a music app, you might be using a code like this to play songs in your iOS app: - (void)next { // Find new index NSUInteger newIndex; // Create a new audio player for this index NSError *error = nil; AVAudioPlayer *newAudioPlayer =[[AVAudioPlayer alloc] initWithContentsOfURL:[(MDAudioFile *)[soundFiles objectAtIndex:selectedIndex] filePath]…

Serializing/Deserializing dates to/from ISO 8601 format with Ember data

Ember Data is a persistence layer for Ember.Js. Without any configuration, Ember Data can load and save records and their relationships served via a RESTful JSON API, provided it follows certain conventions. By default, Date in Ember Data is serialised to a UNIX timestamp. This is great for some…