(Newbie) Have Tips on Loading Remote Dictionary?
(Newbie) Have Tips on Loading Remote Dictionary?
- Subject: (Newbie) Have Tips on Loading Remote Dictionary?
- From: Peter Sampson <email@hidden>
- Date: Fri, 10 Mar 2006 15:03:44 -1000
Hello,
I'm running some tests and trying to figure out how to load data from
a plist from a remote location (without NSCoder or Archiving). I've
been using code samples found around the web (specifically Scott
Stevenson's sites) to try and get it working -- some of you will no
doubt recognize it.
I want to load a PLIST from a URL and then get the values into ivars
for KVC/Bindings.
The code below will load the data and parse it into a dictionary.
But, it doesn't appear to set the values and update the interface.
All getter/setter methods are working and setup, and "continually
updates values" is also checked for bindings on the interface.
@implementation MainObject
- (void) awakeFromNib
{
[NSApp setDelegate: self];
[self loadDataFromDisk];
}
- (void) loadDataFromDisk
{
NSDictionary * inputValues;
MainObject * person = [[MainObject alloc] init];
NSURL * myURL;
myURL = [NSURL URLWithString: @"http://www.kobry.com/eg.plist"];
NSDictionary * contents;
contents = [NSDictionary dictionaryWithContentsOfURL: myURL];
NSLog(@"%@", contents);
[person setValuesForKeysWithDictionary: inputValues];
}
Thanks for your help!
Cheers,
Peter Sampson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden