Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 24, 2004, 09:15 PM   #1
DavidLeblond
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
Cannot get NSTableView to reload!

I have a tableview that is bound to an array controller. I can add records just fine by using the array controller's add: action. However there is one part in the code that I wish to add additional records. I can add the records to the array controller just fine, but the NSTableView will not add. After I add the records, I can run the "add:" action and the tableview will reload and only then I can see the added records.

Here is a snippet of my code:

Code:
      Author *newAuth;
	newAuth = [[Author alloc] init];
	[[newAuth properties] setValue:@"first" forKey:@"firstname"];
	[[newAuth properties] setValue:@"lost" forKey:@"lastname"];
	[_authors addObject:newAuth];

	[newAuth release];
	[authorsView reloadData];
authorsView is an Outlet connected to my table that is bound to the array controller (_authors, which is an array of Author)

Any ideas? I have tried everything to try to get that thing to refresh!
__________________
www.davidleblond.com
Try my new iPhone game, Claustrophobia!
DavidLeblond is offline   0 Reply With Quote
Old Sep 25, 2004, 03:46 AM   #2
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
Are you saying that the [authorsView reloadData] isn't doing anything?
iMeowbot is offline   0 Reply With Quote
Old Sep 25, 2004, 09:41 AM   #3
DavidLeblond
Thread Starter
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
Quote:
Originally Posted by iMeowbot
Are you saying that the [authorsView reloadData] isn't doing anything?
Exactly... just breezes right by it. No errors, no warnings, no nothing.
__________________
www.davidleblond.com
Try my new iPhone game, Claustrophobia!
DavidLeblond is offline   0 Reply With Quote
Old Sep 25, 2004, 05:49 PM   #4
DavidLeblond
Thread Starter
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
I also noticed this about my Interface, where I connected the TableViews to the controller:



Notice the indexes of the NSTableViews are (,) and ()... why is that? Could that be causing this?
__________________
www.davidleblond.com
Try my new iPhone game, Claustrophobia!
DavidLeblond is offline   0 Reply With Quote
Old Sep 25, 2004, 06:31 PM   #5
Fukui
macrumors 68000
 
Fukui's Avatar
 
Join Date: Jul 2002
Try removing [newAuth release]; and see what happens...
__________________
It's a series of tubes!! - An old man
Fukui is offline   0 Reply With Quote
Old Sep 25, 2004, 06:56 PM   #6
DavidLeblond
Thread Starter
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
Doesn't work.

I should also add, that after adding the newAuth object to the tableView I can get it to appear by changing the sort order on the view by clicking the column headers.
__________________
www.davidleblond.com
Try my new iPhone game, Claustrophobia!
DavidLeblond is offline   0 Reply With Quote
Old Sep 25, 2004, 07:52 PM   #7
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
Oh, I just thought of something. What happens if you send a setNeedsDisplay message right after the reload? I'm thinking that it doesn't visually update without a little kick so that a series of adds won't be too slow.

[I'll also note that others have encountered this problem if an NSTableView's controller happens to be subclassed from NSDocument.]

Last edited by iMeowbot; Sep 25, 2004 at 07:57 PM.
iMeowbot is offline   0 Reply With Quote
Old Sep 25, 2004, 08:08 PM   #8
DavidLeblond
Thread Starter
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
Quote:
Originally Posted by iMeowbot
Oh, I just thought of something. What happens if you send a setNeedsDisplay message right after the reload? I'm thinking that it doesn't visually update without a little kick so that a series of adds won't be too slow.
That didn't work. Good guess though!

There's gotta be something I'm not doing right, I just wish I could figure out what!
__________________
www.davidleblond.com
Try my new iPhone game, Claustrophobia!
DavidLeblond is offline   0 Reply With Quote
Old Sep 25, 2004, 08:21 PM   #9
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
'Fraid of that. tableviews are definitely buggy. Lots of stuff here on random problems epople have with them and a few workarounds. Good luck (and do tell us what eventually works!)
iMeowbot is offline   0 Reply With Quote
Old Sep 25, 2004, 10:22 PM   #10
DavidLeblond
Thread Starter
macrumors 68020
 
DavidLeblond's Avatar
 
Join Date: Jan 2004
Location: Raleigh, NC
I also asked on CocoaDev and got an answer.

For the curious...
__________________
www.davidleblond.com
Try my new iPhone game, Claustrophobia!
DavidLeblond is offline   0 Reply With Quote
Old Sep 25, 2004, 11:16 PM   #11
iMeowbot
macrumors 601
 
iMeowbot's Avatar
 
Join Date: Aug 2003
Grrrrr. Since Openstep is already a published spec, would it really kill them to show the source code for Cocoa? The documentation they supply really doesn't cut it.
iMeowbot is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Can't get NSTableView to use anything other than NSTextFieldCell rossipoo Mac Programming 2 Dec 9, 2009 10:44 PM
I cannot get VNC to connect to my Windows PC =( magiic Mac OS X 3 Aug 18, 2008 08:16 AM
Cannot get jailbreak to connect to my ipod touch famdav iPod touch Hacks 0 Nov 14, 2007 08:10 PM
Cannot get BitTorrent to work after FiOS install the_wallcrawler Mac Applications and Mac App Store 0 Aug 3, 2006 12:31 AM
Internal Modem is Silent - Cannot Get it to make a sound dmetzcher Macintosh Computers 7 Dec 8, 2005 04:51 PM


All times are GMT -5. The time now is 05:50 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC