• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(Newbie) Have Tips on Loading Remote Dictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(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


  • Follow-Ups:
    • Re: (Newbie) Have Tips on Loading Remote Dictionary?
      • From: Ryan Britton <email@hidden>
  • Prev by Date: Re: Getting true parent window of views in drawers
  • Next by Date: Re: (Newbie) Have Tips on Loading Remote Dictionary?
  • Previous by thread: Re: movie trailers from apple.com
  • Next by thread: Re: (Newbie) Have Tips on Loading Remote Dictionary?
  • Index(es):
    • Date
    • Thread