fixed template errors
added objc sample codes
refactoring