Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
I'm trying to get the stringValue from a NSMutableArray from a TableView on user selection but am struggling. The NSLog is showing null so I know I'm doing something wrong, here's the code I'm using:
ok, then you are in the right direction. But you should not get the text from the table view, you should get it from the model (your array).
something like this:
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification { int selectedRow = [notesTable selectedRow];
// here i am supposing your array contains strings. NSString * somethingFromArray = [array objectAtIndex:selectedRow] // Set the text in the textview [[[messageField textStorage] mutableString] setString:somethingFromArray]; }
Thanks nestochi, I realised yesterday that I was using a Dictionary so that was the reason it wasn't working. Finally resolved it in the end though...seemed to take forever!
Replies
If you have an array representing the model, you should get it from there, not from the cell. (it's a guess, not sure what you need).
Just get the selected row, and with that row number, get your data from your array.
if you're trying to get the text the user edited in a tableview cell, you should use
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeBasically I have an NSTextView and a save button. The user can enter into the textView and save the data which is then displayed in a table.
What I'm trying to do is when the user clicks on a tableview cell the text is displayed back in the NSTextView?
The user can then edit the text as necessary and re-save it to the original tableview cell?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomesomething like this:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome