• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sudden exit from NSBrowser deleg.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sudden exit from NSBrowser deleg.


  • Subject: Re: Sudden exit from NSBrowser deleg.
  • From: Public Look <email@hidden>
  • Date: Sat, 6 Dec 2003 10:12:15 -0500

On Dec 6, 2003, at 9:40 AM, Sanri Parov wrote:

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{return [array_nomi_playlists count];}

- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
NSString *table_result=[NSString string];

The above line is nonsense. Why did you do it ?

table_result = [array_nomi_playlists objectAtIndex:rowIndex];
[aTableView reloadData];

Don't reload the table's data from within a method that is called when the table's data is reloaded. I think this his could be an infinite recursion that could result in a crash :(

return table_result;
}



My first advice is that you refresh your understanding of C pointers and the meaning of pointer assignment. My second advice is that you run this code in the debugger and watch what happens. When the exception happens, what does the stack look like. Is it a repeating series of calls to -reloadData and -tableView:objectValueForTableColumn:row: with perhaps a few other methods in between ? If so, you have infinite recursion and you have probably run out of program stack. You might want to refresh your memory about what the stack is in typical implementations of C. If infinite recursion isn't the problem, either step through the code in the debugger or put NSLog statements into the code so that you can see the values of all the arguments just before the crash.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Sudden exit from NSBrowser deleg. (From: Sanri Parov <email@hidden>)

  • Prev by Date: Sudden exit from NSBrowser deleg.
  • Next by Date: Re: drawing performance
  • Previous by thread: Sudden exit from NSBrowser deleg.
  • Next by thread: Toolbars
  • Index(es):
    • Date
    • Thread