How to use NSlock in ios