• 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
NSMutableDictionary and retirieving data from web
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMutableDictionary and retirieving data from web


  • Subject: NSMutableDictionary and retirieving data from web
  • From: Ibrahim Bulut <email@hidden>
  • Date: Mon, 12 Apr 2004 23:16:06 +0200

Hi all,

I have a problems with filling my tableview with data from my
NSMutableDictionary object. The problem is I get hold of the data from
an url wich is tab seperated data stream. Is there any way to fill a
NSDictionary object with this data and give the key names to the data
fields?

example:
NSMutableDictionary *rowData = [[NSMutableDictionary alloc] init];
[rowData setObject:@"12:00" forKey:@"programStart"];
[rowData setObject:@"13:00" forKey:@"programEnd"];
[rowData setObject:@"Channel1" forKey:@"programChannel"];
[rowData setObject:@"News" forKey:@"programTitle"];
[rowData setObject:@"News, sports and weather"
forKey:@"programDescription"];
[rowData setObject:NO forKey:@"programAlarm"];

[channelData addObject:rowData];
[rowData release];

Where channelData is my NSTableView's datasource. If I manually add
items to the rowData object it works fine, but I thought I would ask
you guys if there is a smarter method of doing things. Below is the way
I get my data and store it in an array, but I need to distinguish the
different fields and add keys names to them.

NSString* data2 = [[NSString alloc] initWithContentsOfURL:[[NSURL
alloc] initWithString:theUrl]];
NSMutableArray* myArray = [[NSMutableArray alloc] init];
[myArray addObjectsFromArray:[data2 componentsSeparatedByString:@"\t"]];

Anyone got any ideas to basically fill up an NSMutableDictionary with
keynames from url data?

Thanks.

/Ibrahim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSMutableDictionary and retirieving data from web
      • From: Larry Fransson <email@hidden>
    • Re: NSMutableDictionary and retirieving data from web
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: what happened to this doc?
  • Next by Date: Re: NSMutableDictionary and retirieving data from web
  • Previous by thread: Re: what happened to this doc?
  • Next by thread: Re: NSMutableDictionary and retirieving data from web
  • Index(es):
    • Date
    • Thread