some useful code of IOS