Re: stringWithContentsOfFile:usedEncoding returns no err and no encoding

2014-05-30 Thread Greg Parker
On May 30, 2014, at 9:59 PM, Trygve Inda wrote: > I have a database file exported as text from FileMaker which has several > high-ASCII French characters. > > NSError* error = nil; > NSStringEncoding* enc = nil; > > NSString* contents = [NSString stringWithContentsOfFile:path > usedEncoding:enc

stringWithContentsOfFile:usedEncoding returns no err and no encoding

2014-05-30 Thread Trygve Inda
I have a database file exported as text from FileMaker which has several high-ASCII French characters. NSError* error = nil; NSStringEncoding* enc = nil; NSString* contents = [NSString stringWithContentsOfFile:path usedEncoding:enc error:&error]; This works but enc and error are both nil after

Re: How to write a .icns file

2014-05-30 Thread Gary L. Wade
Maybe you could get by just saving those icons that are more modern? You may truly need to keep them, but there's practically no need for 'ICN#' and their like anymore in modern OS X. The most modern ones (especially the retina-based ones) are just wrappers around PNG, JPEG, image file data, any

Re: Multiple NSTextContainer

2014-05-30 Thread Graham Cox
On 30 May 2014, at 7:55 pm, Leonardo wrote: > Now I would like to save all of that to the disk. How > can I do? > > I thought to assign an ID to each textView and save the connection scheme as > e.g.: >texViewA ID 0 connected to >textViewB ID 1 >textViewC ID 2 > > So when I

Re: NSPredicate and custom sort selector

2014-05-30 Thread Kirk
A string is a string - the user's input will have the ratioValue property available. Up to you to sanity check the user input of course. Kirk Kerekes (iPhone) On May 30, 2014, at 4:56 PM, Trygve Inda wrote: >> Create a property-styled category on NSString that returns the numeric value >>

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
> Create a property-styled category on NSString that returns the numeric value > of a ratio-string -- call it "ratioValue" perhaps. Then you can have a > predicate format of the form: > > @"self.ratioValue > %@.ratioValue" > > -- or whatever. > > The same category would be useful in KVC collect

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
> Create a property-styled category on NSString that returns the numeric value > of a ratio-string -- call it "ratioValue" perhaps. Then you can have a > predicate format of the form: > > @"self.ratioValue > %@.ratioValue" > > -- or whatever. > > The same category would be useful in KVC collect

Re: NSPredicate and custom sort selector

2014-05-30 Thread Kirk
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it "ratioValue" perhaps. Then you can have a predicate format of the form: @"self.ratioValue > %@.ratioValue" -- or whatever. The same category would be useful in KVC collection operations.

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
> On May 29, 2014, at 2:52 PM, Trygve Inda wrote: > >> I have an array of objects. One property of this object is a ratio stored as >> a string (e.g. 5:8, 9:4, 21:2) etc. >> >> I have a category on NSString: >> >> -(NSComparisonResult)compareAspectString:(NSString *)aString >> >> This does the

NSTextFieldCell Drawing Offset in NSTextView

2014-05-30 Thread Keary Suska
I am using an NSTextField-with-image technique taken from the Drag N Drop Outline View sample code, but when the custom cell is "edited" in an NSTextField the drawing is offset down and to the right. Unedited drawing is fine and editing in an NSTableView is fine. The following code seems most r

Multiple NSTextContainer

2014-05-30 Thread Leonardo
I have 3 NSTextViews A, B and C sharing the same text. To do that I added the second textViewB.textContainer and the third textViewC.textContainer to the first textViewA.layoutManager. [textViewA.layoutManager addTextContainer:textViewB.textContainer]; [textViewA.layoutManager addTextContainer:tex