Greg,

I understand your proposition. For some reason, the spaces are stripped off by 
the e-mail system, but you got it right.
 Actually, segmentDict contains the copy of a global dictionary created by the 
method [[MyDocument getSectorSegmentData:(id) sender] > mutableCopy]. 
Unfortunately i cannot give here all the code. Also, when I print the 
datasource and delegate for segmentTableView, it is clear that it is not nil: 
the log shows SelectorController, which is what it should be.
My major puzzle is that all other TableView in the application using different 
datasources get loaded. Cleaning all targets does not change anything.
Brief, the major problem is this: the datasource methods do not get called.
Datasource is not nil at run time, no error in the code. The ArrayController is 
not empty, the code looks fine.


I will go back and review for the thousandth time the code from scratch and all 
the bindings, but up to now, I can't figure out what is wrong.


Thank you.


-----Original Message-----
From: Greg Guerin [mailto:glgue...@amug.org]
Sent: Sunday, December 20, 2009 03:08 PM
To: 'list-cocoa-dev'
Subject: Re: NSTableview datasource issues

> Yes, I set the breakpoint on the data source methods? The > datasource 
> methods are not reached at all.Then you must consider the possibility that 
> your table view has a nil data source, or a data source of a different 
> class.If the methods definitely aren't being called, then simple logic 
> suggests your problem lies somewhere other than that data-source class. 
> Perhaps in the creation or assignment of the data-source. Perhaps in the 
> creation or use of the table view. You'll have to backtrack it to find 
> out.Another possibility is some kind of error or mismatch between your source 
> and your compiled code, where what's loaded and debugged isn't what you have 
> in your source. Doing a Clean build usually fixes such errors.> 
> -(id)tableView:(NSTableView *)aTableView> 
> ObjectValueForTableColumn:(NSTableColumn *)aTableColumn> row:(int)rowIndex> 
> {I'm pretty sure that's the wrong method name. Check the capitalization.If 
> your source code is correct, then it was probably mangled by mailing. The 
> list-archives post was also stripped of a lot of necessary whitespace, so 
> capital-mangling would not surprise 
> me.http://lists.apple.com/archives/cocoa-dev/2009/Dec/msg01215.html> 
> -(IBAction)initializeSectorSegmentData:(id) sender> {> 
> segmentDict=[[MyDocument getSectorSegmentData:(id) sender] > mutableCopy];> 
> [segmentDict retain];> NSWindow *w =[segmentTableView window];> [w 
> makeKeyWindow];> //Fill the table row by row;> int i=0;> NSMutableArray 
> *aXtemp;> if ([segmentIndustryData count]>0) [segmentIndustryData > 
> removeAllObjects];> [[segmentDataController content] removeAllObjects];> for 
> (id key in segmentDict)(Note: I have inserted spaces in the above based on 
> what seems reasonable. I may have guessed wrong.)This code looks odd, 
> especially considering you're also setting segmentDict to an empty dictionary 
> in the -init method. The assignment to segmentDict in -init may be 
> problematic, depending on where else that global variable is used.First, 
> getSectorSegmentData appears to be a class method. That seems unusual to me. 
> It may be justified, but it still seems unusual.Second, it's unclear whether 
> the returned dict assigned to segmentDict actually contains anything or not. 
> If not, then the 'for' loop will get no keys, the loop body will never 
> execute, and self's ivars will contain no objects. If that happens, then the 
> data- source has a count of 0 and contains nothing.A data-source which 
> contains nothing differs from a data-source's methods never being called or a 
> data-source object being nil. The visible effect may be similar, an empty 
> table-view, but the execution path is different. -- 
> GG_______________________________________________Cocoa-dev mailing list 
> (Cocoa-dev@lists.apple.com)Please do not post admin requests or moderator 
> comments to the list.Contact the moderators at 
> cocoa-dev-admins(at)lists.apple.comHelp/Unsubscribe/Update your 
> Subscription:http://lists.apple.com/mailman/options/cocoa-dev/aronisoft%40afroamerica.netThis
>  email sent to aronis...@afroamerica.net
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to