Update to support IOS 7.1 and later

Update to support IOS 7.1 and later. But detected "potential leak of memory pointed to by 'samples'".