Comments for Coffee & Cocoa http://www.martinkahr.com hot bits and bytes Sun, 18 May 2008 10:49:23 +0000 http://wordpress.org/?v=2.2.1 Comment on Mac Keys for Eclipse by gabe http://www.martinkahr.com/2006/02/13/mac-keys-for-eclipse/#comment-12784 gabe Fri, 25 Apr 2008 19:48:17 +0000 http://www.martinkahr.com/2006/02/13/mac-keys-for-eclipse/#comment-12784 <p>Just a note: shift+z should redo</p> Just a note:
shift+z should redo

]]>
Comment on Composition Builder by martin http://www.martinkahr.com/2007/06/05/composition-builder/#comment-12237 martin Wed, 09 Apr 2008 07:24:22 +0000 http://www.martinkahr.com/2007/06/05/composition-builder/#comment-12237 <p>Please contact the guys at ToolsOnAir to get a demo version. They removed the download section from their website. Email to sales@toolsonair.com</p> Please contact the guys at ToolsOnAir to get a demo version. They removed the download section from their website. Email to sales@toolsonair.com

]]>
Comment on Composition Builder by Darnell Peacock http://www.martinkahr.com/2007/06/05/composition-builder/#comment-12208 Darnell Peacock Tue, 08 Apr 2008 20:24:27 +0000 http://www.martinkahr.com/2007/06/05/composition-builder/#comment-12208 <p>Where is the downloadable version of Composition Builder????</p> Where is the downloadable version of Composition Builder????

]]>
Comment on NSCell Image and Text Sample by glazed http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/#comment-11263 glazed Tue, 11 Mar 2008 08:00:32 +0000 http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/#comment-11263 <p>Guys...</p> <p>check this out: http://kupuk.com/2007/10/08/custom-nscells-with-nsmanagedobjects/</p> <p>It describes a solution for using managed objects in the multi-value custom cells.</p> Guys…

check this out: http://kupuk.com/2007/10/08/custom-nscells-with-nsmanagedobjects/

It describes a solution for using managed objects in the multi-value custom cells.

]]>
Comment on Remote Control Wrapper 2.0 by vinay http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/#comment-11159 vinay Sat, 08 Mar 2008 13:21:56 +0000 http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/#comment-11159 <p>Thanks for publishing this. It will be very useful to my application.</p> Thanks for publishing this. It will be very useful to my application.

]]>
Comment on Remote Control Wrapper 2.0 by martin http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/#comment-9295 martin Wed, 30 Jan 2008 17:52:19 +0000 http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/#comment-9295 <p>Hi Jim,</p> <p>I'm a Cocoa guy and try to avoid Carbon if possible :-) Let's see if I can help.</p> <p>Objective-C is a object orientated language. These means you are executing functions on objects. The Carbon based APIs are in some sense object orientated as well. The main difference is that you are using a number of functions where you provide the data structure in the first parameter.</p> <p>Let's see how some Cocoa code converts to Carbon code: // allocate an Array - there are two function calls: alloc and init here NSMutableArray* a = [[NSMutableArray alloc] init]; // allocate a string object - the next line defines a string object (compareable to CFStringRef) NSString* value = @"some string"; // here we call the function addObject [a addObject: @"some string"];</p> <p>In Carbon it would look like this: CFMutableArrayRef a = CFArrayCreateMutable(NULL, 0, NULL); CFStringRef value = CFSTR("some string"); CFArrayAppendValue(a, value);</p> <p>So it's pretty straight forward to convert Cocoa code to Carbon code as long as there are matching methods in both frameworks. You can even mix Carbon and Cocoa code pretty easy. </p> <p><em>NSArray is “toll-free bridged” with its Core Foundation counterpart, CFArray. What this means is that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object, providing you cast one type to the other. Therefore, in an API where you see an NSArray * parameter, you can pass in a CFArrayRef, and in an API where you see a CFArrayRef parameter, you can pass in an NSArray instance. This arrangement also applies to your concrete subclasses of NSArray. See Carbon-Cocoa Integration Guide for more information on toll-free bridging.</em></p> <p>hope this helps.</p> Hi Jim,

I’m a Cocoa guy and try to avoid Carbon if possible :-) Let’s see if I can help.

Objective-C is a object orientated language. These means you are executing functions on objects. The Carbon based APIs are in some sense object orientated as well. The main difference is that you are using a number of functions where you provide the data structure in the first parameter.

Let’s see how some Cocoa code converts to Carbon code:
// allocate an Array - there are two function calls: alloc and init here
NSMutableArray* a = [[NSMutableArray alloc] init];
// allocate a string object - the next line defines a string object (compareable to CFStringRef)
NSString* value = @”some string”;
// here we call the function addObject
[a addObject: @”some string”];

In Carbon it would look like this:
CFMutableArrayRef a = CFArrayCreateMutable(NULL, 0, NULL);
CFStringRef value = CFSTR(”some string”);
CFArrayAppendValue(a, value);

So it’s pretty straight forward to convert Cocoa code to Carbon code as long as there are matching methods in both frameworks.
You can even mix Carbon and Cocoa code pretty easy.

NSArray is “toll-free bridged” with its Core Foundation counterpart, CFArray. What this means is that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object, providing you cast one type to the other. Therefore, in an API where you see an NSArray * parameter, you can pass in a CFArrayRef, and in an API where you see a CFArrayRef parameter, you can pass in an NSArray instance. This arrangement also applies to your concrete subclasses of NSArray. See Carbon-Cocoa Integration Guide for more information on toll-free bridging.

hope this helps.

]]>
Comment on Mac Keys for Eclipse by Anonymous http://www.martinkahr.com/2006/02/13/mac-keys-for-eclipse/#comment-9293 Anonymous Wed, 30 Jan 2008 17:40:04 +0000 http://www.martinkahr.com/2006/02/13/mac-keys-for-eclipse/#comment-9293 <p>Thanks for the info Andre. Cocoa is for sure the way to go. Now that the Java-Cocoa bridge is deprecated, SWT-Cocoa will be the way to write Cocoa apps with Java. I'm looking forward to it.</p> Thanks for the info Andre.
Cocoa is for sure the way to go. Now that the Java-Cocoa bridge is deprecated, SWT-Cocoa will be the way to write Cocoa apps with Java.
I’m looking forward to it.

]]>
Comment on Mac Keys for Eclipse by Andre http://www.martinkahr.com/2006/02/13/mac-keys-for-eclipse/#comment-9249 Andre Tue, 29 Jan 2008 18:41:01 +0000 http://www.martinkahr.com/2006/02/13/mac-keys-for-eclipse/#comment-9249 <p>martin: Work is now being done towards a Cocoa based version of SWT: http://www.eclipse.org/swt/</p> martin: Work is now being done towards a Cocoa based version of SWT: http://www.eclipse.org/swt/

]]>
Comment on Remote Control Wrapper 2.0 by Jim Crompton http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/#comment-9239 Jim Crompton Tue, 29 Jan 2008 13:35:22 +0000 http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/#comment-9239 <p>"For interacting with the device the IOKit framework is being used. This a C based API. So when you extract the code from the Objective-C classes you can use it in Carbon based applications as well. You have to translate the NSArray/NS… to CFArray/CF… code as well of course."</p> <p>I'd really, really, really like to be able to understand that - but I'm a pure Carbon head and don't do Cocoa. Any chance of a quick Carbon guide?</p> “For interacting with the device the IOKit framework is being used. This a C based API. So when you extract the code from the Objective-C classes you can use it in Carbon based applications as well. You have to translate the NSArray/NS… to CFArray/CF… code as well of course.”

I’d really, really, really like to be able to understand that - but I’m a pure Carbon head and don’t do Cocoa.
Any chance of a quick Carbon guide?

]]>
Comment on AlterEgo, Core Animation and Divide & Conquer by Scott http://www.martinkahr.com/2007/11/29/alterego-core-animation-and-divide-conquer/#comment-8819 Scott Mon, 14 Jan 2008 01:59:22 +0000 http://www.martinkahr.com/2007/11/29/alterego-core-animation-and-divide-conquer/#comment-8819 <p>OsOnG</p> <p>I'm not sure that this is true. This is certainly an example of where you could use Core Animation, but I don't think iChat was re-written in this respect to use Core Animation (since the functionality has been there for longer than CA has been around)</p> OsOnG

I’m not sure that this is true. This is certainly an example of where you could use Core Animation, but I don’t think iChat was re-written in this respect to use Core Animation (since the functionality has been there for longer than CA has been around)

]]>