Re: Identifying Cocoa Methods
Re: Identifying Cocoa Methods
- Subject: Re: Identifying Cocoa Methods
- From: Quincey Morris <email@hidden>
- Date: Sun, 10 Oct 2010 01:06:18 -0700
On Oct 8, 2010, at 16:22, Jason Slack-Moehrle wrote:
> I need to integrate Carbon and Cocoa so that I can replace the existing Carbon GUI elements with Cocoa equivalents. Mostly Dialog Boxes, etc.
>
> I know that I need to write C-ACllable Wrapper Functions for the Cocoa stuff that I need, but I am not sure how to identify what I need to do.
>
> Example. I know that I will probably need to use NSOpenPanel and NSSavePanel. So I need to write a C-Callable Wrapper for the parts of NSSavePanel that I would use? Like: setTitle, setMessage, etc, etc?
I don't think anyone can tell you the best way to proceed, since it depends on so many factors.
Abstractly, I think I'd encourage you to operate at the highest level possible. So, rather than wrapping individual methods, as you seem to be suggesting above, rather transfer into pure Obj-C code for the entire task of handling the open or save dialog, passing in a structure of context information if you need to do something like configure the standard dialog or filter with delegate methods.
That might ease your task by letting you use a natural Obj-C idiom for the Cocoa parts. Also, if you change the rest of (or, more of) the application to Cocoa later, you're not stuck with the task of re-re-converting the Carbonish Cocoa wrappers.
FWIW
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden