RE: Doing it the hard way
Thanks for that, Tim - lots of good comments there.
> Sure you can use the documentation for NSTableView
> and suporting classes to work out how to populate
> a table with data and sort it. But it would be a
> whole lot easier to use Cocoa Bindings.
Briefly, I'm deliberately *not* using Cocoa Bindings because I want to get to grips with 'barefoot Cocoa' itself first. I appreciate that some of this stuff can be simplified with CB, but - on a personal level - I want to thoroughly understand Cocoa itself, and how it's built on top of Carbon, before introducing an additional level of abstraction.
> You don't need properties. Allowing direct access
> to object data breaks the concept of encapsulation.
> Otherwise they are just accessor methods to the data.
Properties don't break encapsulation. But they are a more convenient way of doing things, if only from a syntactic sugar point of view. This is why Apple are introducing properties in ObjC 2.0 with Leopard. That said, I doubt that Apple will retrospectively "propertize" (for want of a better word!) the existing Appkit framework.
> The inspector palette is the equivalent of a
> property palette. If you create your own custom
> controls then you can also create a IBPalette plug-in
> so others can easily configure and use it within IB.
Yes - that's all understood. My point was that XCode/IB are not oriented towards component-based design. With Delphi or C# (for example), you create your new custom control and the job is done. With XCode/IB, you create your control, and you then *THEN* have to go through the completely separate process of creating an IB plug-in for it.
Why is this extra step needed? In one word, metadata. XCode/IB does not have a reflection mechanism whereby the properties/events of a new control can be interrogated and automatically displayed on the component palette. It is incredibly crude compared to .NET or VCL technologies.
> IB has many shortcomings, it hasn't had the major
> overhaul that ProjectBuilder -> XCode had, but I'd
> still take the Apple supplied controls over the
> Windows ones. Try creating a table view that has
> ruler bars in Visual Studio/.Net.
IB is being overhauled (somewhat) in Leopard. But it is still miles away from what it should be. When you say "Windows controls", which ones are you talking about? Check out the stuff available from www.devexpress.com (both VCL and .NET) and then try implementing that under Cocoa. You may be gone some time! :-)
> I've not used Delphi so I can't comment on that, but
> .Net and Visual Studio I do use regularly. Personally
> I prefer the NeXT way.
Personally, I don't. ;-)
> Using Visual Studio in the way you describe results
> in disorganised code and duplication. Two buttons
> that perform ultimately the same action must still
> have their own handler, even if it's only a wrapper
> to a worker method.
It sounds like you need to get deeper into VS.NET. It is actually dead easy with .NET and Delphi to have multiple buttons pointing at the same handler, and use the sender method to perform disambiguation in the code.
> ProjectBuilder and InterfaceBuilder were way ahead
> of the times when they were produced in 1986. Since
> then other tools caught up, and even bettered
> them in some areas.
I'd agree with that, though I'd tend to replace "some" with "many". ;-)
> XCode 2.0 will make live even easier for the developer
> to do cool stuff. CoreAnimation is amazing. If you
> want to have a play with the precursor in Tiger,
> open up the Quartz Compositor app installed as part
> of the Dev tools and play.
No disagreement that Quartz and CoreAnimation are awesome compared to what's on the PC. I already have Leopard, by the way :- I have ADC membership.
> Garbage collection is added to Objective-C, if you
> like that sort of thing.
I do. ;-)
> In all I think Cocoa is still strong in all the areas
> it was originally. Other advances have happened in the
> developer world and XCode will have to play catch up.
Agreed.
> But I feel better working with a very well designed
> framework with tools that aren't the best in every way,
> than working with an inferior framework in better tools.
I don't believe that .NET and VCL are inferior frameworks to Cocoa. Quite the reverse. I would prefer to use the best tools with the best framework but unfortunately, neither is available for the Mac right now. Hopefully, that will change....
> From what I know of Delphi, it's basically object pascal. > I can't imagine any of the magic implemented in the
> Cocoa frameworks being implemented in such a strongly
> typed language.
Strongly-typed languages are not necessarily a bad thing - you would be surprised how much magic can be achieved. ;-)
Uncle Mac