change api back to cocoa & support ios5