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

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 13, 2013, 10:20 AM   #1
cpuin
macrumors member
 
Join Date: Feb 2013
NSTableView get selected row data

I want to get the data of NSTableView selected row.But i need to access the Core data data corresponding of the selected row.

i only know how to get the selected row, but not the corresponding data.

Code:
 NSInteger selectedRow = [_contragentSheetTableView selectedRow];
    
    if (selectedRow >= 0) {
        
        NSLog(@"The selected row is %li", selectedRow);
        
    }
    else {
        NSLog(@"No row was selected");
    }
cpuin is offline   0 Reply With Quote
Old Sep 24, 2013, 05:20 PM   #2
devilofspades
macrumors member
 
Join Date: Jul 2011
first off, you should never be accessing "_instanceVarName" directly unless in your init method or inside your custom accessors. instead you should be using "self.instanceVarName". as far as the answer to your question, it depends how you are populating the data from coredata into your tableview. you should have some tabelview delegate methods for filling in your tableview. what is your tableview data source tied to? is it hooked up to your cd datebase? does your tableview actually populate the data you are after or are you not at that point yet?
devilofspades is offline   0 Reply With Quote
Old Oct 2, 2013, 12:08 PM   #3
cpuin
Thread Starter
macrumors member
 
Join Date: Feb 2013
Quote:
Originally Posted by devilofspades View Post
first off, you should never be accessing "_instanceVarName" directly unless in your init method or inside your custom accessors. instead you should be using "self.instanceVarName". as far as the answer to your question, it depends how you are populating the data from coredata into your tableview. you should have some tabelview delegate methods for filling in your tableview. what is your tableview data source tied to? is it hooked up to your cd datebase? does your tableview actually populate the data you are after or are you not at that point yet?
My NSTableView populate core data Entity.
cpuin is offline   0 Reply With Quote

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

Tags
coredata, data, nstableview, selected row

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Edit NSTableView - NSArrayController kikko088 Mac Programming 0 Jan 17, 2013 09:57 AM
[?] App/Tweak that cancels data connection to selected Apps ? SKATE4LIFE iPhone and iPod touch Apps 0 Sep 1, 2012 12:48 PM
Asynchronous NSURLConnections + NSTableView Help jwei92 Mac Programming 0 Jul 10, 2012 09:42 PM
Delete a row from Core Data UITableView with custom button mdhansen5 iPhone/iPad Programming 1 Jun 14, 2012 03:24 PM

Forum Jump

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

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

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