Re: dynamically adding NSTableColumns while using bindings
Re: dynamically adding NSTableColumns while using bindings
- Subject: Re: dynamically adding NSTableColumns while using bindings
- From: "I. Savant" <email@hidden>
- Date: Thu, 2 Aug 2007 13:21:37 -0400
Gordon:
Your post is missing a huge amount of information necessary for
others to begin to grasp your problem. Back up, take a deep breath,
and try this again ...
> Please tell me how you got this to work with a document. I have been
> tried everything except sacrificing a goat to get this to work.
What, *specifically* "doesn't work"? What did you expect to happen?
What *EXACTLY* happens instead?
> I have occasionally
> gotten the initial values of my dictionary to appear in the my table, but
> get nothing but crashes when I click on anything in my table view or try to
> add another row.
What do you see in the run log when your app crashes? Does the app
actually crash or are you simply receiving an exception and are forced
to quit due to the malfunction? Without this information, you're
telling the doctor "it hurts" but not what, where, and how, then
expecting an accurate diagnosis.
> My document has a root object course of type "Course" which contains a
> (mutable) dictionary (course.properties) and a (mutable) array
> (course.subList) of "Session" objects, the latter having a (mutable)
> dictionary (properties). In my nib file, I have successfully been able to
> bind an object controller to a tab view with text fields and the document's
> course.properties. The other tab contains the table.
What does the table represent / to what is it bound? The "subList"
property representing an array of Sessions? Exactly how is this bound
(since you later say clicking an item in this table is where your app
blows up).
> (I have also tried this without tabs.)
Okay. Most likely irrelevant, but ... okay. ;-)
> MyDocument has (KVC compliant) accessors for course,
> Course has accessors for properties and subList, Session has accessors for
> properties. In the nib file, I bind the table columns to an array
> controller, which I bind to "file owner" MyDocument. The course object is
> currently created and initialized (with one initialized Session object) in
> MyDocument initialization.
More details, please. "I bound a column to a controller" tells us
next to nothing. To what controller key / model key path did you bind?
The devil, as they say, is in the details.
> I have even tried it with dumping the course
> object and using separate iVars for properties and subList.
It sounds, from a design standpoint, like this is a better approach
anyway. If your document only ever has one "Course" then doesn't the
document itself represent the course? If done right, either design
should still work, however.
I digress.
> I have experimented with various combinations of path specifications.
Such as?
> Like is said, occasionally I get initial dictionary values to show in the
> table, but clicking anything in the table is deadly.
Which combinations were successful?
> I set -NSBindingDebugLogLevel 1 but that still didn't help much.
Neither does your post. Since you haven't told us what's in your run
log, we don't know what's causing the crash, and therefore have no
idea if the problem is even *related* to Bindings. If it *is*, the
results of enabling Bindings debug logging may not have made sense to
you, but they might to someone else ...
You really need to be more specific when posting technical
questions. Give this page a good, solid read - it will help you get
better answers from the list in the future:
http://catb.org/~esr/faqs/smart-questions.html
Once you read that, try re-posting your problem with as much
relevant technical detail as you can possibly muster. This is where
all that practice essay writing you did in school comes in handy. It
sounds like you may be having more than one problem due to more than
one misconception. Clearly stating your goal, then your tries, then
your failures will paint a much better picture for others who are
completely unfamiliar with your project.
--
I.S.
_______________________________________________
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