• 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
Another TableView question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another TableView question...


  • Subject: Another TableView question...
  • From: "Martha I. Espinosa" <email@hidden>
  • Date: Tue, 25 Jan 2005 12:21:51 -0700

Hi,

My data is being read in using the init method. But, if the file doesn't get created until half way through my application. Therefore, my table is displaying nothing/zero/zip. Is there a way that I can use the same code in a different method then call it or reload it to get the data?

- (id)init
{

NSString *path = [NSString stringWithFormat:@"/private/tmp/SWinstallers.txt", NSHomeDirectory()];
NSString *dataAsString = [NSString stringWithContentsOfFile:path];


	NSArray *lines = [dataAsString componentsSeparatedByString:@"\n"];
	int i, count;
	count = [lines count];
	software = [[NSMutableArray alloc] initWithCapacity:count];

for (i = 0; i < count; i++) {
NSArray *words = [[lines objectAtIndex:i] componentsSeparatedByString:@","];
if ([words count] == 5) {
NSMutableDictionary *d = [NSMutableDictionary dictionary];
[d setObject:[words objectAtIndex:0] forKey:@"install"];
[d setObject:[words objectAtIndex:1] forKey:@"name"];
[d setObject:[words objectAtIndex:2] forKey:@"esdname"];
[d setObject:[words objectAtIndex:3] forKey:@"package"];
[d setObject:[words objectAtIndex:4] forKey:@"other"];
}


			[software addObject:d];
		}
	}
	NSLog(@"software = %@", software);
	return self;
}

thanks in advance
_______________________________________________
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: Another TableView question...
      • From: mmalcolm crawford <email@hidden>
    • Re: Another TableView question...
      • From: Stéphane Sudre <email@hidden>
    • Re: Another TableView question...
      • From: Dan Stein <email@hidden>
  • Prev by Date: Re: index column in bound NSTableView
  • Next by Date: Re: NSDocument subclass (newbie) question Š
  • Previous by thread: Re: Simple question: how can I call 'pbxbuild' from the Darwin prompt (where is it?)?
  • Next by thread: Re: Another TableView question...
  • Index(es):
    • Date
    • Thread