Re: Affinity between a document (plain text) file and app-specific parameters for this document

2011-09-23 Thread Ali Ozer
Putting this info in the document (whether or not it's in the actual document itself, or as an extended attribute) is not ideal, since it bakes in the display settings of the last person to view/edit that document. If I send you that document, you should either see it in its default state, or

Re: Open Recent menu - how to populate it?

2009-07-20 Thread Ali Ozer
You can just go ahead and invoke -noteNewRecentDocumentURL: on [NSDocumentController sharedDocumentController]. You don't have to worry about explicitly creating or managing an NSDocumentController, or do anything else that requires NSDocument. TextEdit in Tiger did this (before it was

Re: Reading and writing rtf(d) files

2009-07-02 Thread Ali Ozer
TextEdit sources in /Developer/Examples/AppKit/TextEdit may be useful. TextEdit's document types are set up to read/write RTF and RTFD, in addition to a number of other types. Ali On Jul 2, 2009, at 14:04 , Ian Piper wrote: bump bump :-) Ian. -- ianpi...@mac.com 07590 685840 | 01926

Re: CFAttributedStringGetMutableString returning null value

2009-06-17 Thread Ali Ozer
This function has not been implemented for the pure-CoreFoundation case. This is mentioned in the header comments: (Note: This function is not yet implemented and will return NULL except for toll-free bridged instances.) But it is not in the docs; should be. As the comment implies, you

Re: question about mutable vs. non-mutable

2009-04-30 Thread Ali Ozer
I am pretty new to objective-c, and I've been going over some stuff in a book I bought, and there is just something that is really bothering me. I can't really ask the author a question about his paragraph, so I thought I'd write here instead. So--- This has to do with arrays,

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ali Ozer
One point of the discussion is that there is no need to do this, and things you think you might want to do the test for are probably invalid. But, if you wanted to test, you could see if the instance you have isKindOfClass:[NSCFArray class]. However, this would be fragile, since NSCFArray

Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy

2009-03-31 Thread Ali Ozer
to know I at least have a workaround. Does this tend to indicate some kind of Apple GC bug? From: Ali Ozer ao...@apple.com To: Chris Idou idou...@yahoo.com Cc: Cocoa Dev cocoa-dev@lists.apple.com Sent: Tuesday, 31 March, 2009 4:12:55 PM Subject: Re: EXC_BAD_ACCESS and NSAttributedString driving

Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy

2009-03-30 Thread Ali Ozer
Can you try temporarily disabling garbage collection around the unarchiving of RTFD, and see if it helps? [[NSGarbageCollector defaultCollector] disable]; ... unarchive your RTFD ... [[NSGarbageCollector defaultCollector] enable]; Ali On Mar 30, 2009, at 5:25 PM, Chris Idou wrote: I'm

Re: -hexValue for NSString?

2009-03-24 Thread Ali Ozer
! On Mar 23, 2009, at 6:16 PM, Ali Ozer wrote: NSScanner has - (BOOL)scanHexInt:(unsigned *)value; // Optionally prefixed with 0x or 0X - (BOOL)scanHexLongLong:(unsigned long long *)result; so you can unsigned yourValueHere; BOOL success = [[NSScanner scannerWithString:string

Re: -hexValue for NSString?

2009-03-23 Thread Ali Ozer
NSScanner has - (BOOL)scanHexInt:(unsigned *)value; // Optionally prefixed with 0x or 0X - (BOOL)scanHexLongLong:(unsigned long long *)result; so you can unsigned yourValueHere; BOOL success = [[NSScanner scannerWithString:string] scanHexInt:yourValueHere]; Ali On Mar 23, 2009, at

Re: wordRangeForRange implememtation

2008-05-10 Thread Ali Ozer
There are a number of problems in this code... - (NSRange)wordRangeForRange:(NSRange)range{ NSString *string = [NSString stringWithString:[[self string] substringWithRange:range]]; Why do you make yet another copy of the string; you already have the substring? Maybe you meant to make a

Re: wordRangeForRange implememtation

2008-05-10 Thread Ali Ozer
warning. You should either hang on to the result (assign to string?), or use an NSMutableString to start with and call replaceCharactersInRange:withString: Other comments still apply. Ali Begin forwarded message: From: Ali Ozer [EMAIL PROTECTED] Date: May 10, 2008 7:42:11 PDT

Re: Should a Method set NSError* to nil when No Error?

2008-04-19 Thread Ali Ozer
#define SSYInitErrorP(_error_p) NSError* dummyError ; \ if (_error_p == NULL) { \ _error_p = dummyError ; \ } \ * _error_p = nil ; I use it like this, with an (NSError**)error_p: SSYInitErrorP(error_p) Besides setting *error_p to nil, which we agree is not necessary but I just like, it

Re: Need for a creator code?

2008-04-04 Thread Ali Ozer
When I save a JPEG file in an image editing app, and later open it, I expect it to open in Preview (or whatever my default image viewer is), not the image editing app. This is especially true if someone else opens the image. Of course the expected behavior may depend on whether I am

Re: Need for a creator code?

2008-04-02 Thread Ali Ozer
Totally agreed that seeing extensions on file names is unfortunate. But as long as applications are properly setting/using the hidden extension bit (and many do), most of the time users should not see extensions on any of their files, except the ones where they want to (for instance,

Re: 10.5.2 release notes?

2008-03-06 Thread Ali Ozer
Does anyone know if there are some release notes specific for 10.5.2? I remember reading on some blog that there was an NSTreeController bugfix. ... You mean detailed releases notes geared towards developers? I think they stopped doing that years ago. :( Something like this:

Re: TextEdit-speed file loading

2008-02-28 Thread Ali Ozer
TextEdit calls -[NSLayoutManager setAllowsNonContiguousLayout:YES]; could that be it? Ali On Feb 28, 2008, at 20:06 , Steven Degutis wrote: I have a large (ascii) text file, about 65 MB, which TextEdit loads instantaneously in about a split second. I've tried to mimic this behavior using