Hi. I have a text view on which i m droping a plist file. It's displaying the path of the file which i dropped there. Now i want to read the contents of that file without opening the file. How to do that? Can anybody help me?
+2
A:
EDIT: Have a look at the NSDictionary
and NSMutableDictionary
classes and the Property List Programming Guide.
NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path];
Then you manipulate the dictionary and display (some of) its content in something like NSTableView.
"Now i want to read the contents of that file without opening the file"
I'm afraid it doesn't work that way. To read the content of a file, you have to open the file.
Gregory Pakosz
2010-01-20 10:07:13
what i mean by not opening is that i don't want user to see the contents of that file. User just drag that file on the text view, depending upon that i want to read contents of that file and do some manipulation of it's key values.
Shakti
2010-01-20 10:23:59
That is quite helpful. But how get path of the file from text view?
Shakti
2010-01-20 10:58:04
Gregory Pakosz
2010-01-20 11:00:51
A:
Impossible! You have to open a file in order to read its content - either explicitely or implicitely (e.g. a module/command does it for you)!
LuI
2010-01-20 10:07:48
what i mean by not opening is that i don't want user to see the contents of that file. User just drag that file on the text view, depending upon that i want to read contents of that file and do some manipulation of it's key values.
Shakti
2010-01-20 10:24:38