Re: NSMutableDictionary and retirieving data from web
Re: NSMutableDictionary and retirieving data from web
- Subject: Re: NSMutableDictionary and retirieving data from web
- From: Larry Fransson <email@hidden>
- Date: Mon, 12 Apr 2004 14:59:15 -0700
On Apr 12, 2004, at 14:16, Ibrahim Bulut wrote:
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?
If I understand what you want, something like this should work:
NSArray *keyArray = [[NSArray alloc] initWithObjects:@"programStart",
@"programEnd", @"programChannel", @"programTitle",
@"programDescription", @"programAlarm", nil];
NSString *data2 = [[NSString alloc] initWithContentsOfURL:[[NSURL
alloc] initWithString:theUrl]];
NSArray *myArray = [[NSArray alloc] initWithArray:[data2
componentsSeparatedByString:@"\t"];
NSDictionary *rowData = [[NSDictionary alloc] initWithObjects:myArray
forKeys:keyArray];
[channelData addObject:rowData];
Does that look about right?
Larry Fransson
Seattle, WA
_______________________________________________
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.