[V4CC] 4.8b5, introduce KVC, KVO, CursorController, 3 new examples

Ernesto Giannotta erne at apimac.com
Mon Sep 20 17:29:03 CDT 2010


Hi Ruslan,

I've tested the new VCursorController object and it's really awesome.

Now, let me ask, why not make it a collection controller making it a subclass of NSArrayController?

This way we could bind it to a NSTableView using its arrangedObjects controller key and have a consistent and more flexible way to interact with the cursor.

From the Cocoa Bindings Programming Topics:

> Setting the Content of a Controller
> 
> NSObjectController and its subclasses are initialized with the method initWithContent:, passing a content object or nil if you intend to use the content bindings. You can explicitly set the content of an existing controller using the setContent: method. It is far more common to provide content for controllers by establishing a binding to one of their exposed Controller Content bindings.
> 
> NSObjectController exposes a single binding for content called contentObject. You can establish a binding from contentObject to any object that is key-value-coding and key-value-observing compliant for the keys that you intend to have the controller operate on.
> 
> The collection controllers expose additional bindings: contentArray, contentSet, and contentArrayForMultipleSelection.
> 
> The contentArray binding is bound to an NSArray or an object that implements the appropriate array indexed accessor methods. 
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Similarly the contentSet binding is bound to an NSSet object or an object that implements the appropriate set indexed accessor methods. The indexed accessor patterns are described in Indexed Accessor Patterns for To-Many Properties in the Key-Value Coding Programming Guide.
> 

Of course I've not digged too deep into the implementation difficulties that may arise,
we could pass a VCursor to the – initWithContent: and – setContent: methods,
a simple NSDictionary would likely suffice when returning the arrangedObjects array,
though maybe a VCursorRecord class that knows about its parent cursor could be useful for updating and deleting.

Then the VCursorController could be made capable to handle the sort via NSSortDescriptors and integration with the Cocoa framework would be almost perfect.

Well, I've talked too much as usual :-)
What do you think?

Cool Runnings,
Erne.

p.s.
Sending this to you privately also since the beta list keeps on bouncing back my mails
I've subscribed again, but still waiting for confirmation...

On 17-set-2010, at 14:57, Ruslan Zasukhin wrote:

> On 9/17/10 1:35 AM, "Ernesto Giannotta" <erne at apimac.com> wrote:
> 
> Hi Erne,
> 
> To BETA list:
> 
> * http://www.valentina-db.com/download/beta/4.8b6
> 
>  uploaded V4CC and V4CC_x64  4.8b6
> 
>  * FIXED missing xibs in new examples
>  * Added new method  Valentina.CopyCursorToNewTable()
> 
> 
> 
>> Hello Ruslan,
>> 
>> I was about to try these new KVC features but the examples are missing the
>> .xib files.
>> 
>> Then I tested my bug reports and I'm happy to confirm that all issues are
>> gone! 
>> No more leaks and no more crashes :-)
>> 
>> I found a strange problem though... I'm using a VDatabase subclass calle MyDB
>> that has an init method
>> 
>> - (id) initDatabase;
>> 
>> Well, when I call it like this
>> 
>> mDB = [[MyDB alloc] initDatabase];
>> 
>> Xcode start complaining about a duplicate method name found in the new
>> VDatabaseController class
>> 
>> -(void) initDatabase;
>> 
>> So to make it work I had to rename my method, no big issue but...
>> how can this be?
>> 
>> My class is a VDatabase subclass and VDatabaseController is a
>> NSObjectController subclass, how can they conflict?
>> 
>> Scratching my head...
>> 
>> 
>> On 06-set-2010, at 13:01, Ruslan Zasukhin wrote:
>> 
>>> On 9/6/10 11:58 AM, "Ruslan Zasukhin" <ruslan_zasukhin at valentina-db.com>
>>> wrote:
>>> 
>>> Hi Guys, 
>>> 
>>> http://www.valentina-db.com/download/beta/4.8b5
>>> 
>>> 
>>> You can download new build of V4CC.
>>> 
>>> 
>>> * In the V4CC.Framework/Headers you can see now new folder Cocoa.
>>> 
>>> * And in this folders you can see CATEGORIES for Vcursor class, which add
>>> KVC, KVO. 
>>> 
>>> * Also made datasource interface for VCursor
>>> 
>>> * Also made quite powerful VCursorController which use all above
>>> And can be used in the InterfaceBuilder to visually link
>>> VCursor with 
>>> 
>>> A) TableView
>>> B) Form (set of EditFields and Navigation Buttons)
>>> C) TableView (many records) with linked FORM (current selected row)
>>> 
>>> 
>>> * In the V4CC/Examples/Cocoa folder you can find 3 new examples, each for
>>> one of the above a/b/c/ case
>>> 
>>> 
>>> 
>>> Please take a look at this new features. If you will see something wrong or
>>> bad design please let us know.
>>> 
>>> 
>>> 
>>> ======================================
>>> For INFO:
>>> ======================================
>>> 
>>> * Right now we work on plugin for InterfaceBuilder, which will simplify job
>>> even more. 
>>> 
>>> We will get right in the IB new controls as
>>> 
>>> *  VConnectionController - invisible - here we specify (local)host
>>> 
>>> * VDatabaseController -here we specify database in the scope of above
>>> connection
>>> 
>>> * VCursorController - will be extended even more to allow us specify right
>>> in IB - SQL query to be executed and so on.
> 
> 
> -- 
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> _______________________________________________
> Valentina-beta mailing list
> Valentina-beta at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina-beta




More information about the Valentina-beta mailing list