Cocoa is object oriented, right?

Of course it is. And greatly designed too if you ask me. However there is a huge world of regular functions and macros which you might have overlooked. Here are some of my favorites:

  • UIImagePNGRepresentation(image)
  • UIImageJPEGRepresentation(image,quality)
  • UIImageWriteToSavedPhotosAlbum(image,target,selector,context)
  • UIInterfaceOrientationIsLandscape(orientation)
  • UIInterfaceOrientationIsPortrait(orientation)
  • CGRectIntegral(rect)
  • CGRectInset(rect,dx,dy)
  • CGRectOffset(rect,dx,dy)
  • CGRectStandardize(rect)
  • CGRectDivide(rect,*slice,*remainder,amount,edge)
  • CGRectGetMidX(rect)
  • CGRectGetMidY(rect)
  • MIN(A,B)
  • MAX(A,B)
  • NSStringFromSelector(aSelector)
  • Look them up, they might prove useful, or just make your code easier to read!