This seems to do the trick - you might be able to find a faster/easier/better way, but this is what I came up w/:
- (int)numberOfColumns
{
int numberOfColumns;
NSString *firstLine;
NSScanner *scanner = [[NSScanner alloc] initWithString:@"this,is,a,test,of,the,emergency,b roadcast,system\nthis,is,only,a,test."];
if ( [scanner scanUpToString:@"\n" intoString:&firstLine] )
numberOfColumns = [[firstLine componentsSeparatedByString:@","] count];
else
numberOfColumns = -1; // error
return numberOfColumns;
}