organize the old code and support iOS7

organize the code style and add .gitignore
modify some code in iOS environment