Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Trouble with NSTextView in Dictionaries

Trouble with NSTextView in Dictionaries
Thread Tools
Junior Member
Join Date: Oct 2000
Location: Germany
Status: Offline
Reply With Quote
Mar 7, 2004, 08:26 AM
 
Hello,

I'm experiencing some problems when Inserting values from an NSTextView into
a MutableDictionary and then adding the Dictionary into a Mutable Array.


So here is what I do:
NSMutableDictionary *myDict = [myDict dictionary];

[myDict setObject:[tTitle stringValue] forKey:@"title"];
// tTitle & tLink are TextFields
[myDict setObject:[tDescri string] forKey:@"descri"]; // tLink is my TextView
[myDict setObject:[tLink stringValue] forKey:@"link"];
[arItems addObject:myDict];


This is what happens:
The tTitle and tLink values are added just fine to the array, but the tDescri textfield overwrites
every other "tDescri-value" in the array. I don't know why. I was hoping that somebody could help me out with this and maybe even post a work-around?

Thanks in advance!
Rudy

P.S. Does anybody have a clue what happened to Yellow Box on windows, did Apple kill it?
I know this is OT, but I don't know where else to look for an answer!
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 7, 2004, 04:54 PM
 
-[NSTextView string] does not return a string containing the contents of the view -- it returns the view's actual backing store. As per the documentation, if you want to keep a snapshot of what the text was like at a given time, you'll have to copy it.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2