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
cocoa-dev Mailing List
cocoa-dev Mailing List
Thread Index
[
Prev Page
][
Next Page
]
Re: Loading already scaled JPEGs
From
: Dan Messing <email@hidden>
Re: Loading already scaled JPEGs
From
: Stefan Husch <email@hidden>
Re: A CoreData Limitation?
From
: Bill Bumgarner <email@hidden>
Re: CoreData issue when updating a file format
From
: Bill Bumgarner <email@hidden>
Re: A CoreData Limitation?
From
: Raffael Cavallaro <email@hidden>
Re: CoreData issue when updating a file format
From
: Jim Correia <email@hidden>
NSMovie and DisposeMovie
From
: Des Courtney <email@hidden>
Re: Can NSCell draw both an icon and text?
From
: Nick Zitzmann <email@hidden>
Handling a Null PlaceHolder on a Bound PopUp (with CoreData)
From
: Herve Bouvier <email@hidden>
Re: Can NSCell draw both an icon and text?
From
: James Bucanek <email@hidden>
Re: Can NSCell draw both an icon and text?
From
: James Bucanek <email@hidden>
Re: NEWBIE: Why use protocols?
From
: Cameron Hayne <email@hidden>
Re: A CoreData Limitation?
From
: Philip Riggs <email@hidden>
Re: HTTP server with NetSocket
From
: Cameron Hayne <email@hidden>
Loading already scaled JPEGs
From
: Michael Becker <email@hidden>
NEWBIE: Why use protocols?
From
: "Ben D. Jones" <email@hidden>
Re: Can NSCell draw both an icon and text?
From
: Nick Zitzmann <email@hidden>
HTTP server with NetSocket
From
: Pierre Chatel <email@hidden>
Pie shapes
From
: R T <email@hidden>
Re: Can NSCell draw both an icon and text?
From
: j o a r <email@hidden>
Can NSCell draw both an icon and text?
From
: James Bucanek <email@hidden>
Re: Cocoa Bindings & GUI question
From
: Scott Anguish <email@hidden>
Re: Manually Editing Preferences
From
: Kevin Ballard <email@hidden>
CIImage - saving the file?
From
: Nick Morris <email@hidden>
Re: CoreData issue when updating a file format
From
: Bruno Blondeau <email@hidden>
Re: A CoreData Limitation?
From
: Arthur Schuster <email@hidden>
KVO returning nil for old values, and mmalc's Graphics Bindings example
From
: Tim Lucas <email@hidden>
Re: Timeout for NSCell's trackMouse:inRect:ofView:untilMouseUp:
From
: Ricky Sharp <email@hidden>
Re: embedding web server in cocoa app
From
: Stefan Landvogt <email@hidden>
Re: Menu bar WITHOUT dock icon?
From
: Andy Lee <email@hidden>
Re: detecting NSTableView selected line number with bindings
From
: SA Dev <email@hidden>
Re: CoreData and arrays owned by arrays...
From
: SA Dev <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Steven Kramer <email@hidden>
Re: Cocoa Bindings & GUI question
From
: Nicolas Berloquin <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Scott Anguish <email@hidden>
Re: CoreData issue when updating a file format
From
: Bill Bumgarner <email@hidden>
Base coordinate system definition
From
: Neil Williams <email@hidden>
Re: detecting NSTableView selected line number with bindings
From
: Steven Kramer <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Denis Stanton <email@hidden>
Re: CoreData issue when updating a file format
From
: Bruno Blondeau <email@hidden>
Hidden window with NSMovieView makes QT stutter?
From
: Andreas Pardeike <email@hidden>
Re: A CoreData Limitation?
From
: Bill Bumgarner <email@hidden>
Re: CoreData and arrays owned by arrays...
From
: Lee Morgan <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: mmalcolm crawford <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Denis Stanton <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: mmalcolm crawford <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Denis Stanton <email@hidden>
Re: Trying to solve a to-many relationship?
From
: Scott Stevenson <email@hidden>
Trying to solve a to-many relationship?
From
: Michael Carter <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: mmalcolm crawford <email@hidden>
Re: How best to archive in CSV format
From
: Mont Rothstein <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Denis Stanton <email@hidden>
Re: CoreData and arrays owned by arrays...
From
: Lee Morgan <email@hidden>
Re: Timeout for NSCell's trackMouse:inRect:ofView:untilMouseUp:
From
: Daniel Jalkut <email@hidden>
Re: How best to archive in CSV format If you haven't already solved this here is some code that may help. It does this for tsv files, tweaking it for csv files shouldn't be that much work. If you do mod this for csv, I'd love to get that code back, but it isn't required. Enjoy, -Mont Sorry, no docs. @interface NSArray (BNExtensions) - (NSArray *)tabJoinedComponents; - (NSString *)joinAsLinesOfEndingType:(LineEndingType)type; - (NSData *)dataWithLineEndingType:(LineEndingType)lineEndingType; @end @implementation NSArray (BNExtensions) - (NSArray *)tabJoinedComponents { NSEnumerator *components; NSMutableArray *rows; NSArray *row; components = [self objectEnumerator]; rows = [NSMutableArray arrayWithCapacity: [self count]]; while (row = [components nextObject]) { [rows addObject: [row componentsJoinedByString: @"\t"]]; } return rows; } - (NSString *)joinAsLinesOfEndingType:(LineEndingType)lineEndingType { switch (lineEndingType) { case LineEndingTyp! eDOS : return [self componentsJoinedByString: @"\r\n"]; case LineEndingTypeMac : return [self componentsJoinedByString: @"\r"]; case LineEndingTypeUnix : return [self componentsJoinedBy String: @"\n"]; default : return [self componentsJoinedByString: @""]; } } - (NSData *)dataWithLineEndingType:(LineEndingType)lineEndingType; { NSArray *rows; NSString *dataString; rows = [self tabJoinedComponents]; dataString = [rows joinAsLinesOfEndingType: lineEndingType]; return [dataString dataUsingEncoding: NSASCIIStringEncoding]; } @end @interface NSData (BNExtension) - (NSArray *)rowsAndColumns; @end @implementation NSData (BNExtension) - (NSArray *)rowsAndColumns { NSString *fileContents; NS_DURING fileContents = [[[NSString alloc] initWithData: self encoding: NSASCIIStringEncoding] autorelease]; NS_HANDLER fileContents = nil; [NSException raise: @"Import Error" format: @"There was a problem reading your file. Please make sure that it is a Tab delimited file. Additional information:\n\nException: %@\nReason: %@\nDetail: %@", [localException name], [localException reason], [localException userInfo]]; NS_ENDHANDLER return [[fileContents lines] valu! eForKey: @"tabSeparatedComponents"]; } @end typedef enum { LineEndingTypeNone = 0, LineEndingTypeDOS = 1, LineEndingTypeMac = 2, LineEndingTypeUnix = 3, } LineEndingType; @interface NSString (BNExtensions) - (NSArray *)lines; - (NSArray *)tabSeparatedComponents; - (NSArray *)rowsAndColumns; @end @implementation NSString (BNExtensions) - (LineEndingType)lineEndingType { NSRange lineEndRange; // Is this alineEndRangeDOS format? lineEndRange = [ self rangeOfString:@"\r\n"]; if (lineEndRange.location != NSNotFound) return LineEndingTypeDOS; // Not DOS; is this the Mac format? lineEndRange = [self rangeOfString:@"\r"]; if (lineEndRange.location != NSNotFound) return LineEndingTypeMac; // Not DOS or Mac, is this Unix format? lineEndRange = [self rangeOfString:@"\n"]; if (lineEndRange.location != NSNotFound) return LineEndingTypeUnix; // This string has a single line return LineEndingTypeNone; } - (NSArray *)lines { LineEndingType lineEndingType; lineEndingType = [self lineEndingType]; switch (lineEndingType) { case LineEndingTypeDOS : return [self componentsSeparatedByString: @"\r\n"]; case LineEndingTypeMac : return [self componentsSeparatedByString: @"\r"]; case LineEndingTypeUnix : return [self componentsSeparatedByString: @"\n"]; default : return [NSArray arrayWithObject: self]; } } - (NSArray *)tabSeparatedComponents { return [self componentsSeparatedByString: @"\t"]; } - (NSArray *)rowsAndColumns { re! turn [[self lines] valueForKey: @"tabSeparatedComponents"]; } @end
From
: Mont Rothstein <email@hidden>
Re: CoreData and arrays owned by arrays...
From
: mmalcolm crawford <email@hidden>
Re: getting the key window from another application
From
: Keith Alperin <email@hidden>
CoreData and arrays owned by arrays...
From
: Lee Morgan <email@hidden>
NSCharacterSet and NSCaseInsensitiveSearch
From
: Christopher Drum <email@hidden>
Re: Figuring out which values are selected in an NSTableView
From
: Scott Anguish <email@hidden>
Figuring out which values are selected in an NSTableView
From
: Andrew White <email@hidden>
Does the CD predicate syntax support the mod operator?
From
: Scott Ellsworth <email@hidden>
NSBezierPath question?
From
: R T <email@hidden>
Re: Cocoa view design considerations
From
: Tim Lucas <email@hidden>
Re: Menu bar WITHOUT dock icon?
From
: Adam Leonard <email@hidden>
detecting NSTableView selected line number with bindings
From
: Denis Stanton <email@hidden>
detecting NSTableView selected line number with bindings
From
: Denis Stanton <email@hidden>
Re: DidFinishLaunchingNotification vs openFile
From
: Pontus Ilbring <email@hidden>
Re: Cocoa view design considerations
From
: john <email@hidden>
Timeout for NSCell's trackMouse:inRect:ofView:untilMouseUp:
From
: Mark Alldritt <email@hidden>
Re: A CoreData Limitation?
From
: Nicko van Someren <email@hidden>
DidFinishLaunchingNotification vs openFile
From
: Dominic Feira <email@hidden>
Re: How can I update SQLite version within XCode 2.0/Cocoa?
From
: Nicko van Someren <email@hidden>
Re: Building with XCode 2 for Jag and Panther
From
: Mark Williams <email@hidden>
Re: A CoreData Limitation?
From
: mmalcolm crawford <email@hidden>
Re: Checkmark in a popup with bindings
From
: Björn Carlström <email@hidden>
Cocoa view design considerations
From
: xCode <email@hidden>
Re: A CoreData Limitation?
From
: Nicko van Someren <email@hidden>
Re: Checkmark in a popup with bindings
From
: Scott Stevenson <email@hidden>
Re: How can I update SQLite version within XCode 2.0/Cocoa?
From
: Scott Stevenson <email@hidden>
Re: A CoreData Limitation?
From
: Bill Bumgarner <email@hidden>
Checkmark in a popup with bindings
From
: Björn Carlström <email@hidden>
Re: A CoreData Limitation?
From
: mmalcolm crawford <email@hidden>
Re: Bindings & empty strings
From
: Jens Miltner <email@hidden>
Re: A CoreData Limitation?
From
: Nicko van Someren <email@hidden>
Re: Different NSCells in one NSTableView/NSTableColumn
From
: Matt Neuburg <email@hidden>
Re: A CoreData Limitation?
From
: Arthur Schuster <email@hidden>
Re: A CoreData Limitation?
From
: Óscar Morales Vivó <email@hidden>
Re: A CoreData Limitation?
From
: Arthur Schuster <email@hidden>
Re: A CoreData Limitation?
From
: SA Dev <email@hidden>
Re: A CoreData Limitation?
From
: Nicko van Someren <email@hidden>
Re: How best to archive in CSV format
From
: Denis Stanton <email@hidden>
Re: How best to archive in CSV format
From
: Denis Stanton <email@hidden>
Re: A CoreData Limitation?
From
: Arthur Schuster <email@hidden>
Re: A CoreData Limitation?
From
: Arthur Schuster <email@hidden>
NSTextfield updating values but not clearing values with bindings
From
: Cornelius Jaeger <email@hidden>
Re: Sharing instances between NIB's?
From
: mmalcolm crawford <email@hidden>
Javabeans in Cocoa/ObjC?
From
: Dix Lorenz <email@hidden>
Re: Newbie Bindings Question
From
: SA Dev <email@hidden>
Re: A CoreData Limitation?
From
: Ruslan Zasukhin <email@hidden>