Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 28, 2012, 02:09 AM   #1
Marimuthu
macrumors member
 
Join Date: Oct 2010
Update single row in NSScrollView

Dear All,

I have a scroll view control which i used to display some data.
Is it possible for me to just update a single row which I select in the scroll view?

I know that I can call reloadData on the scroll view object but this will update all the elements in the row which I do not desire.

I did try this code

Quote:
NSRect rectForDisplay = [ viewObj rectOfRow:rowSelected ];
[viewObj setNeedsDisplayInRect:rectForDisplay];
But I find that any changes to the data corresponding to the row (at the backend) is not reflected/updated in that row.

Could somebody help me resolve this issue?

Thanks & Regards.
Marimuthu is offline   0 Reply With Quote
Old Mar 30, 2012, 01:03 AM   #2
Marimuthu
Thread Starter
macrumors member
 
Join Date: Oct 2010
Is it not possible to update an individual cell in a scroll view?

Don't I have any other option but to call reloadData method?

Thanks & Regards.
Marimuthu is offline   0 Reply With Quote
Old Mar 30, 2012, 03:36 AM   #3
blueillusion
macrumors member
 
Join Date: Aug 2008
 
Do you mean update a single row in a tableview (embedded in a scroll view?)
If so, it is definitely possible. I'm doing this in a few of my own apps as well.

When I get home from work, I'll try to paste the relevant code.
I ran into the same problem as you, but I can't exactly remember the correct solution at the moment.
blueillusion is offline   0 Reply With Quote
Old Mar 30, 2012, 04:13 AM   #4
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by Marimuthu View Post
Dear All,

I have a scroll view control which i used to display some data.
Is it possible for me to just update a single row which I select in the scroll view?

I know that I can call reloadData on the scroll view object but this will update all the elements in the row which I do not desire.
You can't call reloadData on a scroll view. You can call it on a tableview inside the scroll view.

Now read the documentation for reloadData and read a bit further on that page.
gnasher729 is offline   0 Reply With Quote
Old Mar 30, 2012, 04:15 AM   #5
Marimuthu
Thread Starter
macrumors member
 
Join Date: Oct 2010
Yes, I want to update a single row.

I am relatively new to UI development hence please forgive me if my question is obvious to many.

In my app, I call the reloadData using an object derived from NSScrollView to update all the rows. I am working on a project which this UI was implemented by somebody else who is not available now.

I am not sure if I am embedding the tableview into scrollview.

If there is an mechanism to get the pointer to tableview from Scrollview object and then using the tableview object to access and update individual cells in table view, then i think the requirement is achieved.
Marimuthu is offline   0 Reply With Quote
Old Mar 30, 2012, 10:36 PM   #6
Sydde
macrumors 68000
 
Sydde's Avatar
 
Join Date: Aug 2009
Quote:
Originally Posted by Marimuthu View Post
If there is an mechanism to get the pointer to tableview from Scrollview object and then using the tableview object to access and update individual cells in table view, then i think the requirement is achieved.
Try the NSScrollView method -documentView, that should return the table view.
__________________
You got to be a spirit. You can't be no ghost.
Sydde 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

Similar Threads
thread Thread Starter Forum Replies Last Post
Reset Flipped NSScrollView abcdefg12345 Mac Programming 2 May 8, 2014 12:44 AM
Single Dead Pixel - Will Apple Exchange? (Update: it's dirt) madsci954 iPhone 16 Oct 9, 2013 01:48 PM
Mac Pro 5,1: Single cpu = Single socket? zopiro Mac Pro 5 Oct 28, 2012 05:37 PM
NSScrollView: copy on scroll ineffective. jeanlain Mac Programming 2 Aug 24, 2012 12:31 PM
MAS - Using a single update for multiple computers laserbeam273 Mac Applications and Mac App Store 4 Jul 2, 2012 05:37 PM

Forum Jump

All times are GMT -5. The time now is 09:55 AM.

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

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC