Re: core data - beyond the simple example
Re: core data - beyond the simple example
- Subject: Re: core data - beyond the simple example
- From: Torsten Curdt <email@hidden>
- Date: Fri, 4 Apr 2008 19:26:03 +0200
Again me not being precise enough. So IIUC the NSTableView has
NSTableColumns which have NSTableCells. I would have assumed that
NSTableCells is also a view - which is why I talked about views.
Right now
the cell is a NSTextFieldCell. I somehow need to replace that with
something
bigger. Something that can have multiple controls that I then can
bind to
the other attributes.
Incorrect. A cell is a cell. A view is a view.
http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/Concepts/AboutControlsCells.html
Ups
Replacing a data cell for a column (for the basic cells) is easy.
Building a table view whose cells actually use views is not.
I see ...well, I just want more attributes in one cell then :)
To get
you started:
http://www.stepwise.com/Articles/Technical/2003-12-20.01.html
Thanks!
... this is nontrivial. Doubly-so when Bindings is thrown into the
mix. You're in for a world of hurt with your current level of
understanding, but good luck. :-)
:-)
Just think of something along the lines of
@interface MyObject : NSObject
{
NSString *name;
NSString *color;
}
In this case, as I said, just do it the easier way first so you
understand what's involved. Then if you want a 'subview as a cell in a
table', you'll have a much easier time. To do it the simple way,
you'll need to make the necessary adjustments for your color column in
code.
1 - Subclass NSCell (probably NSImageCell would be easiest, YMMV) and
get it to draw whatever color is given as its value.
2 - Obtain a reference to your "color" column and set its data cell to
your NSCell subclass (like "MyColorCell".
More may be needed, but I'm busy and this is as much thought as I've
put into it.
I'll give that a go, thanks. May I ask why NSImageCell?
It's really more about getting more values into the one NSTableCell.
Simple, huh? Except that with the approach you're taking, not so
much. ;-)
:-)
With respect, you're biting off way more than you have the teeth to
chew at the moment. It's not just a Core Data thing as your subject
line suggests. You're actually missing a few very critical
prerequisite topics:
Well, you have to have goals :-)
1 - How views(controls) and cells work.
2 - How to configure a table view (to use custom cells).
3 - POTENTIALLY how to intermix bindings and table data source methods
(for custom cells).
4 - Bindings (and probably the required KVC/KVO concepts).
5 - NSController/NSArrayController specifics (such as how to filter
here, as well as the fact that 'here' is 'where' you filter).
...working on it! :)
cheers
--
Torsten
_______________________________________________
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