Headers and referencing pre defined objects.
Headers and referencing pre defined objects.
- Subject: Headers and referencing pre defined objects.
- From: Kevin Bracey <email@hidden>
- Date: Thu, 9 Mar 2006 17:47:07 +1300
Hi all,
In Cocoa it seems that if the answers not right there in front of me
then I've got the wrong idea:-) So I'm looking for the correct concept
more than a specific solution.
Maybe your advice or some links could help me, please.
I have a set of Controls NSTableViews, NSComboBoxs and NSTextFeilds
connected to MyDocument. I'm not using bindings just IBOutlets.
I have my NSObject custom Delegates and DataSources, these are being
set in the windowControllerDidLoadNib.
I pass the DataSources, NSMutableArrays from my DataModelObjects,
loaded through the other MyDocument messages.
What I'm trying to achieve is that when the User clicks on a row/s in a
tableview, the text in the textFeild changes and other rows in a
different TableView get selected.
In the TableView delegate I'm getting it's NSIndexSet after it's been
clicked, this is all going well.
Passing this back to the MyDocument is the headscratch:-) I started off
using Notifications, but found that when you have more than 1 document
open every Document got the message.
Then I thought I would reference the document, (not actual code but you
get the idea) [[[[aNotification object] window] document]
updateOtherControls:myIndexSet].
Then I thought I'd go via the sharedController] currentDocument]
updateOtherControls:myIndexSet]
Then I thought why not just pass the MyDocument to the Delegate and be
done with it.
[myTableViewDelegate setMyDocument:self]
[holdMyDocument updateOtherControls:myIndexSet]
#import "MyDocument.h" in "MyTableViewDelegate .h" while it is also in
"MyDocument.h" seems to cause a circular header problem. You can see
I'm not a C programmer:-)
So I'm looking for 2 clues, firstly the correct way to get a control
delegate to update other Controls on the same window.
And secondly how to have ObjectA passed to ObjectB when ObjectA can
also have ObjectB. I realise this could lead to mem leaks if not
handled carefully.
Your help would be greatly appreciated,
Kevin Bracey
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden