• tel: 0845 475 2487 (UK)

Scale-9 in Objective-C Cocoa on the Mac

Developed by Jon

Having used flash extensively for the last few years I have really come to rely on using Scale-9 scaling on UI elements in the rich internet apps I design and develop. It is a great technique for things like rounded rectangles, button graphics etc and ensuring the rounded corners do not distort when stretched.

I have recently been doing Cocoa Development on Mac OS X 10.5 and was looking for a way to do this in Cocoa and came across a great drawing method named NSDrawNinePartImage. The method has the following signature:

void NSDrawNinePartImage(NSRect frame,
   NSImage *topLeftCorner,
   NSImage *topEdgeFill,
   NSImage *topRightCorner,
   NSImage *leftEdgeFill,
   NSImage *centerFill,
   NSImage *rightEdgeFill,
   NSImage *bottomLeftCorner,
   NSImage *bottomEdgeFill,
   NSImage *bottomRightCorner,
   NSCompositingOperation op,
   CGFloat alphaFraction,
   BOOL flipped
);

Read more…

Objective-J & Cappuccino

Developed by Simon

This may be an unusual first post in my Objective-C and Cocoa categories however it is quite relevant as the guys behind 280 Slides have released a new open source extension to the Javascript language known as Objective-J and a new Javascript framework based on Cocoa named Cappuccino.

Other than having a very nice logo designed by the guys at Sofa my first impressions are they have implemented Objective-C in javascript. To me this seems an unusual choice as I can’t image there are that many developers (within the web development industry) who are that familiar with Objective-C. Maybe I am wrong, certainly with the current gold rush to develop for the iPhone this will increase. I must admit I have been toying with Objective-C recently and once I got the hang of the syntax am really starting to enjoy it. So maybe there is method to their madness? Read more…