profile for monkeydom at Stack Overflow, Q&A for professional and enthusiast programmers

cocoa-dom

coding bits I use, come across, like, hate, the whole shebang.

twitter | github | mastodon     rant-dom     rss | archive

Permalink
Home

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!