Use NSData APIs instead of memcpy()