Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-12 Thread Corbin Dunn

On Mar 11, 2010, at 7:55 PM, Alexander Bokovikov wrote:

 
 On 11.03.2010, at 23:25, Corbin Dunn wrote:
 
 http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/
 
 I've done what was told there. No difference. I just get EXC_BAD_ACCESS in 
 XCode status line and debugger's call stack list shows:
 
 objc_msgSend
 - [NSTableView _dataSourceValueForColumn:row: ]
 
 
 and a long chain is below, but there are no my project lines there. All 
 lines are from Cocoa itself. It looks like the window requires for update 
 after dataSource is already released.

it still could be caused by something you did. It is hard to say! I'd have to 
see the bt (like I mentioned earlier).


 
 This is how I call the modal window:
 
 - (void) doModalWnd{
   MyWnd *wnd = [[MyWnd alloc] init];
   [[NSApplication sharedApplication] runModalForWindow:[wnd window]];
   [wnd release];
 }
 
 - (IBAction) myBtnClick:(NSButton *)sender {
   [self performSelector:@selector(doModalWnd)
  withObject:nil
  afterDelay:0];
 }
 
 There is such code within MyWnd.m:
 
 - (void)windowWillClose:(NSNotification *)notification {
   [[NSApplication sharedApplication] stopModalWithCode:NSCancelButton];
 }
 
 Is there anything criminal here?
 

something's causing something to redraw the table after your datasource was 
dealloced. Just call [tableView setDatasource:nil] in your datasourc'es 
dealloc. That will probably fix the issue.

.corbin

 Thanks.
 

___

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


NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov

Hi, All.

I have a table view in the main window, where it works fine. And  
have yet another very similar table view in a popup modal panel. where  
it fails immediately after panel is closed. Debugger shows subj, as  
the failure point. In both cases dataSource for table view is assigned  
in the IB statically.


The problem disappears if I clear dataSource assignment in the IB and  
include this assignment into awakeFromNib of the window controller.  
Also I include [myTableView setDataSource:nil] into -windowWillClose  
event handler of the same window controller. I tried to manipulate  
with release when closed option of the window - no effect.


What it could be?

Thanks.
___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Fritz Anderson
On 11 Mar 2010, at 9:38 AM, Alexander Bokovikov wrote:

 I have a table view in the main window, where it works fine. And have yet 
 another very similar table view in a popup modal panel. where it fails 
 immediately after panel is closed. Debugger shows subj, as the failure point. 
 In both cases dataSource for table view is assigned in the IB statically.

1. You don't say what fail means. A crash? What error code? What stack trace?

2. This is all moot, because, as the leading underscore shows, 
_dataSourceValueForColumn:row: is a private method. It is not meant to be 
called by anyone but Apple. It is likely that only Apple knows what the 
preconditions and postconditions for calling it are; and they can change those 
conditions at any time. 

I Googled _dataSourceValueForColumn:. Have you noticed that virtually all the 
hits have titles like Arbitrary Crashes, Bug, Consistently crashes, 
issue, crashes everytime, Crash in my... data source?

3. Now that I re-read your message, you don't say whether you're implementing 
_dataSourceValueForColumn:row: or calling it; or even whether you're using it 
at all. Even if you're just implementing it, the principle holds: You don't 
know what the method is required to do, and you don't know what it will be 
required to do in 10.6.3. (Note for archives: The current version of Mac OS X 
is 10.6.2.)

What are you trying to accomplish, and why do you think it cannot be done with 
supported API?

— F

___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Corbin Dunn

On Mar 11, 2010, at 7:38 AM, Alexander Bokovikov wrote:

 Hi, All.
 
 I have a table view in the main window, where it works fine. And have yet 
 another very similar table view in a popup modal panel. where it fails 
 immediately after panel is closed. Debugger shows subj, as the failure point. 
 In both cases dataSource for table view is assigned in the IB statically.
 
 The problem disappears if I clear dataSource assignment in the IB and include 
 this assignment into awakeFromNib of the window controller. Also I include 
 [myTableView setDataSource:nil] into -windowWillClose event handler of the 
 same window controller. I tried to manipulate with release when closed 
 option of the window - no effect.
 
 What it could be?

Break on objc_exception_throw.

corbin


___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov

On Thursday, March 11, 2010 at 10:11 PM Fritz Anderson wrote:


1. You don't say what fail means. A crash?
What error code? What stack trace?


EXC_BAD_ACCESS. Assembler call stack view shows line next to the subj call.

OS X 10.5.8 Never tried it in 10.6.X


2. This is all moot, because, as the leading underscore shows,
_dataSourceValueForColumn:row: is a private method.
It is not meant to be called by anyone but Apple. It is likely
that only Apple knows what the preconditions and postconditions
for calling it are; and they can change those conditions at any time.


Of couse, I never called it directly. I never implemented it. I just _use_ 
NSTableView. Nothing more. The fact is that it is working nice in the main 
app, where it is never destroyed explicitly. But it doesn't work correctly 
in a modal window, which I create and then release. As I've described the 
only way I've found is to assign the datasource explicitly in awakeFromNib 
and set it to nil explicitly in windowWillClose handler.


Really my question was - is this a known bug, a feature or my mistake?

Thanks. 


___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov


On Thursday, March 11, 2010 at 10:29 PM Corbin Dunn wrote:


Break on objc_exception_throw.


Could you explain it? What does it mean?

Thanks.
___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Fritz Anderson
On 11 Mar 2010, at 11:44 AM, Alexander Bokovikov wrote:

 Of couse, I never called it directly. I never implemented it. I just _use_ 
 NSTableView. Nothing more. The fact is that it is working nice in the main 
 app, where it is never destroyed explicitly. But it doesn't work correctly in 
 a modal window, which I create and then release. As I've described the only 
 way I've found is to assign the datasource explicitly in awakeFromNib and set 
 it to nil explicitly in windowWillClose handler.

I misunderstood. My mistake.

Have you run with zombies enabled? It's almost the first thing you should do if 
you get an EXC_BAD_ACCESS in framework code. Also, be sure Run  Stop on 
Objective-C Exceptions is checked.

— F

___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Eli Bach

On Mar 11, 2010, at 10:44 AM, Alexander Bokovikov wrote:

 Of couse, I never called it directly. I never implemented it. I just _use_ 
 NSTableView. Nothing more. The fact is that it is working nice in the main 
 app, where it is never destroyed explicitly. But it doesn't work correctly in 
 a modal window, which I create and then release. As I've described the only 
 way I've found is to assign the datasource explicitly in awakeFromNib and set 
 it to nil explicitly in windowWillClose handler.
 
 Really my question was - is this a known bug, a feature or my mistake?

Alexander,

This seems to describe that you are releasing the datasource before the 
tableview that uses it is released [possibly by over-releasing it, as I would 
assume the tableview would retain it, but it may not].

Maybe make sure your window is released before the source is released.  Or at 
the very least, that the window is closed/offscreen before the source is 
released.

Eli

___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Corbin Dunn

On Mar 11, 2010, at 9:48 AM, Alexander Bokovikov wrote:

 
 On Thursday, March 11, 2010 at 10:29 PM Corbin Dunn wrote:
 
 Break on objc_exception_throw.
 
 Could you explain it? What does it mean?

http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/

corbin


___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Corbin Dunn

On Mar 11, 2010, at 9:44 AM, Alexander Bokovikov wrote:

 On Thursday, March 11, 2010 at 10:11 PM Fritz Anderson wrote:
 
 1. You don't say what fail means. A crash?
 What error code? What stack trace?
 
 EXC_BAD_ACCESS. Assembler call stack view shows line next to the subj call.
 
 OS X 10.5.8 Never tried it in 10.6.X
 
 2. This is all moot, because, as the leading underscore shows,
 _dataSourceValueForColumn:row: is a private method.
 It is not meant to be called by anyone but Apple. It is likely
 that only Apple knows what the preconditions and postconditions
 for calling it are; and they can change those conditions at any time.
 
 Of couse, I never called it directly. I never implemented it. I just _use_ 
 NSTableView. Nothing more. The fact is that it is working nice in the main 
 app, where it is never destroyed explicitly. But it doesn't work correctly in 
 a modal window, which I create and then release. As I've described the only 
 way I've found is to assign the datasource explicitly in awakeFromNib and set 
 it to nil explicitly in windowWillClose handler.
 
 Really my question was - is this a known bug, a feature or my mistake?

Howdy! We would really need to see a backtrace at the point of the crash or 
exception being thrown. It is probably a bug in your app.

corbin


___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Alexander Bokovikov


On 11.03.2010, at 23:25, Corbin Dunn wrote:


http://www.corbinstreehouse.com/blog/2008/08/your-most-important-breakpoint-in-cocoa/


I've done what was told there. No difference. I just get  
EXC_BAD_ACCESS in XCode status line and debugger's call stack list  
shows:


objc_msgSend
- [NSTableView _dataSourceValueForColumn:row: ]


and a long chain is below, but there are no my project lines there.  
All lines are from Cocoa itself. It looks like the window requires for  
update after dataSource is already released.


This is how I call the modal window:

- (void) doModalWnd{
MyWnd *wnd = [[MyWnd alloc] init];
[[NSApplication sharedApplication] runModalForWindow:[wnd window]];
[wnd release];
}

- (IBAction) myBtnClick:(NSButton *)sender {
[self performSelector:@selector(doModalWnd)
   withObject:nil
   afterDelay:0];
}

There is such code within MyWnd.m:

- (void)windowWillClose:(NSNotification *)notification {
[[NSApplication sharedApplication] stopModalWithCode:NSCancelButton];
}

Is there anything criminal here?

Thanks.

___

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


Re: NSTableView _dataSourceValueForColumn:row: failure

2010-03-11 Thread Eli Bach

On Mar 11, 2010, at 8:55 PM, Alexander Bokovikov wrote:

 Is there anything criminal here?

Is the datasource for the NSTableView still a valid, non-released object when 
the window is closed?

Eli

___

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