update the Sample Code from https://developer.apple.com/library/prerelease/ios/samplecode