How to detect a Retina Mac

2013-08-18 Thread Gerriet M. Denkmann
I just noticed that the program I use to create Png files creates files with twice the number of pixels in each dimension. Obviously because since I last used it, I have switched to a Retina Mac Book. Ok, so I have to fix this program. But: how do I detect that the programm is running on a compu

Re: How to detect a Retina Mac

2013-08-18 Thread Gerriet M. Denkmann
On 18 Aug 2013, at 20:09, Tom Davie wrote: > > On 18 Aug 2013, at 15:03, Gerriet M. Denkmann wrote: > >> I just noticed that the program I use to create Png files creates files with >> twice the number of pixels in each dimension. >> Obviously because since I la

Re: How to detect a Retina Mac

2013-08-18 Thread Gerriet M. Denkmann
On 18 Aug 2013, at 21:03, Tom Davie wrote: > > On 18 Aug 2013, at 15:56, Gerriet M. Denkmann wrote: > >> >> On 18 Aug 2013, at 20:09, Tom Davie wrote: >> >>> >>> On 18 Aug 2013, at 15:03, Gerriet M. Denkmann wrote: >>> >>

Re: How to detect a Retina Mac

2013-08-19 Thread Gerriet M. Denkmann
On 19 Aug 2013, at 06:41, Marcel Weiher wrote: My problem is: "... some drawing here ..." seems to assume a locked NSImage in place. It looks like: NSUInteger graphicIndex = [graphics count]; while (graphicIndex-- > 0) { SKTGr

Re: How to detect a Retina Mac

2013-08-19 Thread Gerriet M. Denkmann
On 19 Aug 2013, at 14:17, Lee Ann Rucker wrote: >> I seem to need a way to tell NSImage NOT to double the pixels for me, but I >> don't see any way to do this. > > Have you tried my sample code? This part seems to be what you're looking for: > > NSBitmapImageRep *bmpImageRep = > [NSBit

Re: How to detect a Retina Mac

2013-08-19 Thread Gerriet M. Denkmann
On 19 Aug 2013, at 14:17, Graham Cox wrote: > > On 19/08/2013, at 9:01 AM, Gerriet M. Denkmann wrote: > >> I seem to need a way to tell NSImage NOT to double the pixels for me, but I >> don't see any way to do this. >> Like: [ image setBackingScaleFactor:

Re: How to detect a Retina Mac

2013-08-19 Thread Gerriet M. Denkmann
On 19 Aug 2013, at 17:35, Graham Cox wrote: > > On 19/08/2013, at 12:05 PM, Gerriet M. Denkmann wrote: > >> Here is the final code (if there is anything wrong or not quite right, >> please feel free to critizise it): > >> [NSGraphicsContext set

Re: How to detect a Retina Mac

2013-08-20 Thread Gerriet M. Denkmann
On 19 Aug 2013, at 19:18, Alex Zavatone wrote: > Sent from my iPad > > On Aug 18, 2013, at 11:16 AM, "Gerriet M. Denkmann" > wrote: > >> But I do not understand it. CIImage, CGImage, NSImage > > I know it's not much, but CI = Core Image, CG = Core

Converting to Arc → undeclared identifier

2013-08-20 Thread Gerriet M. Denkmann
Trying to convert an older project to Arc, Xcode complains about "Use of undeclared identifier '_privateDate'". And threatens that nothing will be done unless I fix this first. Well - for one: without Arc there are no undeclared identifiers. (Builds without error or warnings). The class with pr

Re: Converting to Arc → undeclared identifier

2013-08-20 Thread Gerriet M. Denkmann
(maybe only in 64 bit?). > > On Aug 20, 2013, at 1:07 PM, Gerriet M. Denkmann wrote: >> Trying to convert an older project to Arc, Xcode complains about "Use of >> undeclared identifier '_privateDate'". >> And threatens that nothing will be done unle

Re: Converting to Arc → undeclared identifier

2013-08-20 Thread Gerriet M. Denkmann
On 20 Aug 2013, at 20:27, Fritz Anderson wrote: > Sure, but the whole point the OP is trying to make is that the purported > error is being raised by the refactoring process that is _supposed to remove > that retain_. Refactoring would be a very easy process indeed if doing the > conversion y

Re: Converting to Arc → undeclared identifier

2013-08-20 Thread Gerriet M. Denkmann
On 20 Aug 2013, at 21:41, Jens Alfke wrote: > This looks like a bug in Xcode’s refactoring tool — seems it doesn’t > understand the auto-synthesize feature. I would take your test case and > attach it to a new Radar bug report to Apple. Just done this. Bug 14784266. Gerriet. _

Re: Converting to Arc → undeclared identifier

2013-08-20 Thread Gerriet M. Denkmann
On 20 Aug 2013, at 21:54, glenn andreas wrote: > > On Aug 20, 2013, at 8:43 AM, Gerriet M. Denkmann wrote: > >> >> On 20 Aug 2013, at 20:27, Fritz Anderson wrote: >> >>> Sure, but the whole point the OP is trying to make is that the purported >>

NSMetadataQuery resultAtIndex:

2013-08-25 Thread Gerriet M. Denkmann
I have a program which runs fine, except for the days it does not. I then creates an exception like: "*** -[NSMetadataQuery resultAtIndex:]: index (454) out of bounds (0)". The culprit is always NSMetadataQuery resultAtIndex:. The problem: when I start to debug, this exception soon goes away. Wh

Mutating message sent to immutable object

2013-08-31 Thread Gerriet M. Denkmann
I have an NSObjectController called objectController with content bound to locationDictionary. @property (strong) NSMutableDictionary *locationDictionary; And an NSArrayController called arrayController which has its content bound to objectController.myArrayKey. This array contains colu

Evil setFrame:

2013-09-07 Thread Gerriet M. Denkmann
I try to show a nib (which uses autolayout and which contains among other things a NewView inside an NSClipView inside an NSScrollView ) like this: if ( self.neuWindowController == nil ) { // NewWindowController is subclass of NSWindowController self.neuWindowController =

Re: Evil setFrame:

2013-09-08 Thread Gerriet M. Denkmann
On 8 Sep 2013, at 12:04, Kyle Sluder wrote: > On Sat, Sep 7, 2013, at 09:36 PM, Gerriet M. Denkmann wrote: >> I try to show a nib (which uses autolayout and which contains among other >> things a NewView inside an NSClipView inside an NSScrollView ) like

AuthorizationExecuteWithPrivileges deprecated

2013-09-11 Thread Gerriet M. Denkmann
I have this code: AuthorizationRefauth; OSStatus aa = AuthorizationCreate( NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth); const char *pathToTool = [ theHelperPath fileSystemRepresentation ]; const char *const arguments[] = { "--self-repair", NULL }; FILE *commu

NSTextView Font Substitution

2008-05-18 Thread Gerriet M. Denkmann
I have an NSTextView with no "Multiple fonts allowed" (isRichText = NO). The font is the userFixedPitchFontOfSize: 0 (Monaco 10 pt). But when I insert a THAI CHARACTER SARA E (Unicode 0E40), which has no glyph in Monaco, a replacement font is used. This is Lucida Grande, which is not a FixedP

Bindings: Allows Editing Multiple Values Selection

2008-05-19 Thread Gerriet M. Denkmann
I have (in Tiger 10.4.11) a nib with an NSTextField. It's value is bound to "myInt" in MyObjectController (an NSObjectController) - Controller Key: selection. The content outlet of MyObjectController is connected to the File's Owner, which is of class MyOwner. MyOwer has an instance variabel

Re: Bindings: Allows Editing Multiple Values Selection

2008-05-20 Thread Gerriet M. Denkmann
On 20 May 2008, at 03:23, Scott Ellsworth wrote: Ok, use todays tools: Xcode -> Help -> Documentation. Type "Allows Editing Multiple Values Selection" got nothing in either Api or Full Text Search. Well. Google on : site:developer.apple.com/documentation/Cocoa Allows Editing Multiple Valu

Re: Bindings: Allows Editing Multiple Values Selection

2008-05-20 Thread Gerriet M. Denkmann
On 20 May 2008, at 01:50, Ken Thomases wrote: This is an example where the reference documentation doesn't guide you to the relevant conceptual documentation very well. Spotlight shows me also "/Developer/ADC Reference Library/ releasenotes/Cocoa/AppKit.html", which mentions this flag wit

Re: Localization and plural rules revisited

2008-05-20 Thread Gerriet M. Denkmann
On 20 May 2008, at 23:03, [EMAIL PROTECTED] wrote: On May 20, 2008, at 12:08 PM, Peter Edberg wrote: CLDR (Common Locale Data Repository) has some draft data on plural forms for various languages. See

NSConnection does not close ports

2008-05-22 Thread Gerriet M. Denkmann
I have a server, which does create an NSConnection on some NSSocketPort and publishes this fact via Bonjour. A client opens a connection, sends some messages via Distributed Objects, and closes it again. This implies opening and closing a few file descriptors on sockets. Works fine. Usually.

Re: NSConnection does not close ports

2008-05-22 Thread Gerriet M. Denkmann
On 22 May 2008, at 15:37, Adam R. Maxwell wrote: On May 22, 2008, at 12:13 AM, Gerriet M. Denkmann wrote: I have a server, which does create an NSConnection on some NSSocketPort and publishes this fact via Bonjour. A client opens a connection, sends some messages via Distributed Objects

Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)

2008-05-22 Thread Gerriet M. Denkmann
On 23 May 2008, at 01:38, [EMAIL PROTECTED] wrote: On May 22, 2008, at 11:15 AM, Jonathan Hendry wrote: Perhaps a better way of doing this would be a web or WebKit app with two panes. One that shows the Apple docs at Apple's site, and the other pane points to a page at a non-Apple wiki site t

Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)

2008-05-23 Thread Gerriet M. Denkmann
On 23 May 2008, at 08:54, Scott Anguish wrote: On May 23, 2008, at 2:23 AM, Gerriet M. Denkmann wrote: 1. For me the documentation would be very hard to use without the excellent AppKiDo. 2. It really should be Apple's job to provide something like AppKiDo. There is new bro

Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)

2008-05-23 Thread Gerriet M. Denkmann
On 23 May 2008, at 11:49, Ken Thomases wrote: On May 23, 2008, at 3:09 AM, Gerriet M. Denkmann wrote: I do seem to remember that there was something to write files and folders to a CDs using an Objective-C interface. - entered "disk" into AppKido - nothing except NSURLCache.

Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]

2008-05-24 Thread Gerriet M. Denkmann
On 23 May 2008, at 23:30, [EMAIL PROTECTED] wrote: From what I have read quickly since Sean McBride sent his comment, UTIs are not yet implemented to the point where I could get the UTI of every file on my computer. Sure you can. Use LSCopyItemAttributes() with kLSItemContentType. How

Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)

2008-05-24 Thread Gerriet M. Denkmann
On 23 May 2008, at 23:18, Shawn Erickson wrote: On Fri, May 23, 2008 at 9:19 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: So I - entered "disc recording" into Xcode -> Help -> Documentation - nothing at all ...talking about Xcode 2.5 in the following...

Change the Language of just one Application

2008-05-24 Thread Gerriet M. Denkmann
Somewhere I have read (if my memory is not faulty) that it is possible to lauch an app with some arguments (or environment variables?) changing the preference order of languages. E.g. my preferred language is English, but I want to test the German localization of some app. Xcode allows me

Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)

2008-05-24 Thread Gerriet M. Denkmann
On 25 May 2008, at 03:00, Ken Thomases wrote: On May 24, 2008, at 12:36 AM, Gerriet M. Denkmann wrote: On Fri, May 23, 2008 at 9:19 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: So I - entered "disc recording" into Xcode -> Help -> Documentation - nothing a

NSMetadataItem attributes

2008-05-28 Thread Gerriet M. Denkmann
I have an NSMetadataItem, which gives me via attributes a list of keywords. But: kMDItemPath is not in this list, although NSString *itemPath = [ item valueForAttribute: (NSString *) kMDItemPath ]; gives a reasonable answer. On the other hand, this aforementioned list of attributes contai

NSPredicate containing contains

2008-05-28 Thread Gerriet M. Denkmann
NSString *searchString = @"SpoD"; NSString *predicateFormat = @"kMDItemFSName contains %@"; NSPredicate *predicate = [ NSPredicate predicateWithFormat: predicateFormat, searchString ]; NSMetadataQuery *query = [[NSMetadataQuery alloc] init]; [ query setPredicate: predicate]; // <---

Re: NSPredicate containing contains

2008-05-28 Thread Gerriet M. Denkmann
On 29 May 2008, at 02:02, [EMAIL PROTECTED] wrote: 5/28/08 12:10 PM, also sprach [EMAIL PROTECTED]: NSString *searchString = @"SpoD"; NSString *predicateFormat = @"kMDItemFSName contains %@"; NSPredicate *predicate = [ NSPredicate predicateWithFormat: predicateFormat, searchString ]; NSMeta

NSPredicate: To be, or not to be

2008-06-01 Thread Gerriet M. Denkmann
When I use an NSMetadataQuery with the NSPredicate it seems to find all documents which contain these words in any order; and as they are kind of common, it finds 23363 files. Not quite what I intended. Actually I am looking for those documents which contain this string exactly as writte

Re: NSPredicate: To be, or not to be

2008-06-01 Thread Gerriet M. Denkmann
On 2 Jun 2008, at 00:20, [EMAIL PROTECTED] wrote: On Sun, Jun 1, 2008 at 9:17 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: When I use an NSMetadataQuery with the NSPredicate "To be, or not to be;"> it seems to find all documents which contain these words in any ord

Re: NSPredicate: To be, or not to be

2008-06-02 Thread Gerriet M. Denkmann
On 2 Jun 2008, at 16:52, [EMAIL PROTECTED] wrote: On Sun, Jun 1, 2008 at 9:10 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: Following your suggestion, I changed my predicateFormat to: @"%@ contains kMDItemTextContent" which translates into: and behaves more or less e

Re: NSPredicate: To be, or not to be

2008-06-02 Thread Gerriet M. Denkmann
On 3 Jun 2008, at 03:30, stephen joseph butler wrote: On Mon, Jun 2, 2008 at 11:08 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: Constucting the format properly (copying your suggestion): NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K contains %@", kM

Re: NSPredicate: To be, or not to be

2008-06-03 Thread Gerriet M. Denkmann
On 3 Jun 2008, at 11:52, [EMAIL PROTECTED] wrote: On Mon, Jun 2, 2008 at 7:37 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: On 3 Jun 2008, at 03:30, stephen joseph butler wrote: I'm sorry. I forget that the Spotlight predicate strings are slightly different from the r

Re: NSPredicate: To be, or not to be

2008-06-03 Thread Gerriet M. Denkmann
On 3 Jun 2008, at 15:33, Hamish Allan wrote: On Tue, Jun 3, 2008 at 1:37 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: This one also works for me. Only it kind of works too well, finding thousands of files. Another example: finds ".../Test.txt" which only contains th

Digital Librarian

2008-06-03 Thread Gerriet M. Denkmann
I am trying to create a Cocoa version of the old NeXT Digital Librarian. To complete it, I would like to have the original icon. Now I am right now about 10 000 km from my own NeXT Cube. Does anybody out there still has a working NeXT and is willing to send me a copy of the Digital Librarian ico

ArrayController Out of Bounds

2008-06-04 Thread Gerriet M. Denkmann
I have an NSTableView with one column which creates exceptions when sorted. 10.4.11. [ tableColumn infoForBinding: @"value" ] --> NSObservedKeyPath = "arrangedObjects.kMDItemPath"; NSObservedObject = [object class: NSMetadataItem, number of selected objects: 1]; NSOptions = {

Re: ArrayController Out of Bounds

2008-06-07 Thread Gerriet M. Denkmann
On 4 Jun 2008, at 21:50, Shawn Erickson wrote: On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: When this table contains some rows and I click on the table column header I always get: *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5) where 5

Unicode names

2008-07-18 Thread Gerriet M. Denkmann
Is there a way (Cocoa, Carbon or whatsoever) to get the Unicode name of a character? Like: unicodeName( 0x1D110 ) = "MUSICAL SYMBOL FERMATA". Sure, I could (at least on 10.4.11) read /System/Library/Perl/5.8.6/ unicore/UnicodeData.txt, but as Unicode names are used in Edit -> Special Charac

avoid AlertPanel in opening a document

2008-07-19 Thread Gerriet M. Denkmann
In -readFromURL:ofType:error: of a document-based app I make some checks and if something looks suspicious I show an AlertPanel with: "Something strange. (Open anyway) (Do not open)" If the user clicked on (Do not open) I return NO and set the NSError to nil. But then another panel comes

Re: Unicode names

2008-07-19 Thread Gerriet M. Denkmann
On 19 Jul 2008, at 08:41, Adam R. Maxwell wrote: On Jul 18, 2008, at 5:45 AM, Gerriet M. Denkmann wrote: Is there a way (Cocoa, Carbon or whatsoever) to get the Unicode name of a character? Like: unicodeName( 0x1D110 ) = "MUSICAL SYMBOL FERMATA". Sure, I could (at least on 10.

Re: avoid AlertPanel in opening a document

2008-07-19 Thread Gerriet M. Denkmann
On Sat, 19 Jul 2008 09:43:57 -0700, Quincey Morris <[EMAIL PROTECTED]>wrote: On Jul 19, 2008, at 01:58, Gerriet M. Denkmann wrote: In -readFromURL:ofType:error: of a document-based app I make some checks and if something looks suspicious I show an AlertPanel with: "Something str

reloading an NSTreeController

2008-08-02 Thread Gerriet M. Denkmann
I have myContentArray, bound to the contentArray of an NSTreeController. And an OutlineView which has its columns bound to the same NSTreeController. I do [ myContentArray addObject: someObject ] and this is shown in the OutlineView. Everything works very nicely. - (IBAction)revertDocume

Non-editable TableView and the Evil NSEditorBinder

2008-08-02 Thread Gerriet M. Denkmann
I have a TableView with DataSource who's columns are set (in IB) to Editable. When the thing gets loaded from its nib I do for its columns: NSTextFieldCell *aCell = [ aTableColumn dataCell ]; [ aCell setEditable: NO ]; [ aCell setSelectable: YES ]; So I have a table with selectable, but not e

Re: Non-editable TableView and the Evil NSEditorBinder

2008-08-02 Thread Gerriet M. Denkmann
On 3 Aug 2008, at 04:21, Keary Suska <[EMAIL PROTECTED]> wrote: 8/2/08 7:30 AM, also sprach [EMAIL PROTECTED]: [...] Then I tried to use an NSArrayController instead of the DataSource. But now some evil NSEditorBinder comes and makes my cells editable again. Most annoying! Well, it looks

Re: reloading an NSTreeController

2008-08-02 Thread Gerriet M. Denkmann
On 3 Aug 2008, at 05:51, Jonathan Dann wrote: On 1 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: But all disclosure triangels are now closed. Is there some way to reopen them to the previous state? I have the strong feeling that I will have to handle this myself. Ok. So be it. It

Re: Non-editable TableView and the Evil NSEditorBinder

2008-08-03 Thread Gerriet M. Denkmann
On 3 Aug 2008, at 12:02, Ken Thomases wrote: On Aug 2, 2008, at 10:00 PM, Gerriet M. Denkmann wrote: Well, I looked at the nib again, and the only binding I can see is the value of the TableColumn bound to arrangedObjects.Values of some NSArrayController. What is the setting of the

Re: reloading an NSTreeController

2008-08-04 Thread Gerriet M. Denkmann
On 3 Aug 2008, at 16:53, Jonathan Dann wrote: On 3 Aug 2008, at 04:35, Gerriet M. Denkmann wrote: On 3 Aug 2008, at 05:51, Jonathan Dann wrote: On 1 Aug 2008, at 14:04, Gerriet M. Denkmann wrote: But all disclosure triangels are now closed. Is there some way to reopen them to the

Colour of Symlink

2008-08-04 Thread Gerriet M. Denkmann
I want to get the colour of a symlink (NOT the colour of the thing the symlinks points at). Is there a Cocoa way to get this? Currently I am using FSPathMakeRef (or CFURLGetFSRef) to get an FSRef, and then FSGetCatalogInfo to get the colour. But both FSPathMakeRef and CFURLGetFSRef seem to

Re: Colour of Symlink

2008-08-05 Thread Gerriet M. Denkmann
On 5 Aug 2008, at 14:37, Jean-Daniel Dupas wrote: Le 5 août 08 à 08:13, Gerriet M. Denkmann a écrit : I want to get the colour of a symlink (NOT the colour of the thing the symlinks points at). Is there a Cocoa way to get this? Currently I am using FSPathMakeRef (or CFURLGetFSRef) to get

How to debug a corrupted stack

2008-08-05 Thread Gerriet M. Denkmann
I have a document based app which works perfectly with -O0 or -O1 but crashes with -O2 or higher. When the crash occurs the debugger comes up and says: "Previous frame identical to this frame (corrupt stack?)" When I try to step through the function (which is kind of difficult, as the opt

Re: How to debug a corrupted stack

2008-08-06 Thread Gerriet M. Denkmann
On 6 Aug 2008, at 11:14, Ken Thomases wrote: On Aug 5, 2008, at 9:51 PM, Gerriet M. Denkmann wrote: I have a document based app which works perfectly with -O0 or -O1 but crashes with -O2 or higher. When the crash occurs the debugger comes up and says: "Previous frame identical to

Re: How to debug a corrupted stack

2008-08-07 Thread Gerriet M. Denkmann
On 7 Aug 2008, at 01:16, Sean McBride wrote: On 8/6/08 9:51 AM, Gerriet M. Denkmann said: So it is kind of difficult to see where and why the stack gets corrupted. Have you tried 'stack canaries'? <http://lists.apple.com/archives/xcode-users/2007/Dec/msg00055.html> I have

Re: How to debug a corrupted stack

2008-08-07 Thread Gerriet M. Denkmann
On 6 Aug 2008, at 21:56, Shawn Erickson wrote: On Tue, Aug 5, 2008 at 7:51 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: I have a document based app which works perfectly with -O0 or -O1 but crashes with -O2 or higher. When the crash occurs the debugger comes up and says: &qu

Saving Outline View Column Widths

2008-08-07 Thread Gerriet M. Denkmann
I have an OutlineView, which has an Autosave Name set in IB. Works fine. I change a column width, close the document, open another document: the columns are just as they should be. Let's say, I want the first column to be 2 cm wide. Now I click on some disclosure triangle, new rows come up and

Re: Saving Outline View Column Widths

2008-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2008, at 01:21, Corbin Dunn wrote: On Aug 7, 2008, at 10:06 AM, Gerriet M. Denkmann wrote: I have an OutlineView, which has an Autosave Name set in IB. Works fine. I change a column width, close the document, open another document: the columns are just as they should be. Let&#

Re: How to debug a corrupted stack

2008-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2008, at 01:59, Johannes Fortmann <[EMAIL PROTECTED]> wrote: The problem here is that UTCDateTime is defined with #pragma pack 2 in effect. That means the compiler packs with an alignment of 2, so the whole structure has 8 bytes. The proper alignment (4) results in 12 bytes. Since th

Re: How to debug a corrupted stack

2008-08-07 Thread Gerriet M. Denkmann
On 8 Aug 2008, at 09:04, Sean McBride wrote: Gerriet M. Denkmann ([EMAIL PROTECTED]) on 2008-8-8 9:49 PM said: some_type a; NSValue *data = [ NSValue value: &a withObjCType: @encode (some_type) ]; followed by: some_type b; [ data getValue: &b ]; i

Dragging broken symlinks

2008-08-08 Thread Gerriet M. Denkmann
I have an app which can open symlinks (not the thing the symlink points to). Done via [ openPanel setResolvesAliases: NO ]; But when I drag a symlink to the icon of my app in the dock, - (BOOL) application:(NSApplication *)theApplication openFile:(NSString *) filename will have filename =

Re: Dragging broken symlinks

2008-08-09 Thread Gerriet M. Denkmann
On 9 Aug 2008, at 12:27, Ken Thomases wrote: On Aug 8, 2008, at 11:26 PM, Gerriet M. Denkmann wrote: I have an app which can open symlinks (not the thing the symlink points to). Done via [ openPanel setResolvesAliases: NO ]; But when I drag a symlink to the icon of my app in the dock

Re: I don't understand why this is leaking...

2008-08-12 Thread Gerriet M. Denkmann
On 9 Aug 2008, at 17:39:20 -0600, Jonathan deWerd <[EMAIL PROTECTED]>wrote: On Aug 9, 2008, at 4:48 PM, Cate Tony wrote: This code is leaking: - (void)saveItemExtensions:(id)sender { NSMutableString* itemExtensionsFilePath = [NSMutableString stringWithString:@"~/Library/Preferences/MyA

Re: I don't understand why this is leaking...

2008-08-12 Thread Gerriet M. Denkmann
On 12 Aug 2008, at 15:50, Negm-Awad Amin wrote: Am Di,12.08.2008 um 10:42 schrieb Gerriet M. Denkmann: On 9 Aug 2008, at 17:39:20 -0600, Jonathan deWerd <[EMAIL PROTECTED]>wrote: On Aug 9, 2008, at 4:48 PM, Cate Tony wrote: [...] Also, why are you using non-keyed en

Re: I don't understand why this is leaking...

2008-08-12 Thread Gerriet M. Denkmann
On 12 Aug 2008, at 17:19, Graham Cox wrote: On 12 Aug 2008, at 6:42 pm, Gerriet M. Denkmann wrote: 2. NSKeyedArchiver can only store certain strings (tested in 10.4.11), which makes it absolutely unusable for the storage of strings if the possible values are not known in advance. Eh

Re: I don't understand why this is leaking...

2008-08-12 Thread Gerriet M. Denkmann
one say: "germanilly challenged" ?) list-members). Herzliche Grüße aus Bangkok Gerriet. A: Yes. | Q: Are you sure? | | A: Because it reverses the logical flow of conversation. | | | Q: Why is top posting frowned upon? Amin Am Di,12.08.2008 um 12:25 schrieb Gerriet M. Denkmann

Re: I don't understand why this is leaking...

2008-08-12 Thread Gerriet M. Denkmann
On 12 Aug 2008, at 18:05, Graham Cox wrote: On 12 Aug 2008, at 8:40 pm, Gerriet M. Denkmann wrote: I'm sure if it weren't someone would have raised merry hell about it before now. Something's fishy... Reminds of a very rational being walking the streets with his son. Th

Re: I don't understand why this is leaking...

2008-08-12 Thread Gerriet M. Denkmann
On 13 Aug 2008, at 00:05, Jason Coco wrote: On Aug 12, 2008, at 12:50 , Klaus Backert wrote: About $Null: It it were a reserved word, it would be documented so. The "Archives and Serializations Programming Guide for Cocoa" says: Keyed Archives ... Naming Values ... You should avoid us

NSAppleScript shies away from porcupines

2008-08-26 Thread Gerriet M. Denkmann
I want to open some file: source = "tell application "SomeApp" open POSIX file "/Volumes/เม่น/some/file" as alias activate end tell " NSAppleScript *aa = [ [ NSAppleScript alloc ] initWithSource: source ] ; NSDictionary *errorInfo = nil ; NSAppleEventDescriptor *awe = [ a

Re: NSAppleScript shies away from porcupines

2008-08-26 Thread Gerriet M. Denkmann
On 26 Aug 2008, at 15:04, Andrew Farmer wrote: On 26 Aug 08, at 00:39, Gerriet M. Denkmann wrote: I want to open some file: source = "tell application "SomeApp"... You're making things harder than they need to be. [[NSWorkspace sharedWorkspace] openFile:@"/path/t

Re: NSAppleScript shies away from porcupines

2008-08-26 Thread Gerriet M. Denkmann
On 26 Aug 2008, at 20:58, Jason Coco wrote: On Aug 26, 2008, at 04:19 , Gerriet M. Denkmann wrote: On 26 Aug 2008, at 15:04, Andrew Farmer wrote: On 26 Aug 08, at 00:39, Gerriet M. Denkmann wrote: I want to open some file: source = "tell application "SomeApp"... You&#

Re: NSAppleScript shies away from porcupines

2008-08-26 Thread Gerriet M. Denkmann
On 27 Aug 2008, at 02:09, has wrote: Gerriet M. Denkmann wrote: When I try in Script Editor: set macpath to POSIX file "/Volumes/เม่น/Users" as Unicode text and do "Compile", then this gets transformed into: set macpath to file " ‘ßÀÏ:Volumes:‡¡Ëπ:Users" a

Deep Recursion

2008-08-27 Thread Gerriet M. Denkmann
Yesterday I did some nice recursive programming - the only problem was: I did not intend to do so. As a consequence, there was no defined end to the recursion, which made it essentially infinite. Well, memory - specifially stack space - is not infinite, so eventually I got an EXEC_BAD_ADDR

CFBundleIconFile: heiß or hot?

2008-08-27 Thread Gerriet M. Denkmann
// this shows the application default icon if CFBundleIconFile = "heiß" // works ok for CFBundleIconFile = "hot" - (IBAction)iconForFileN: sender; { NSBundle *mainBundle = [ NSBundle mainBundle ]; NSString *bundlePath = [ mainBundle bundlePath ]; NSImage *image = [ [ N

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Gerriet M. Denkmann
On 28 Aug 2008, at 14:37, Michael Nickerson wrote: On Aug 28, 2008, at 2:15 AM, Gerriet M. Denkmann wrote: // this always works, regardless of name: - (IBAction)ImageNameD: sender; { NSBundle *mainBundle = [ NSBundle mainBundle ]; NSDictionary *infoDictionary

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Gerriet M. Denkmann
On 28 Aug 2008, at 22:10, Shawn Erickson wrote: On Thu, Aug 28, 2008 at 5:38 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: But, another problem: when I run my app with CFBundleIconFile = "heiß" the picture in the dock is just the default app icon. What encoding i

Re: CFBundleIconFile: heiß or hot?

2008-08-28 Thread Gerriet M. Denkmann
On 29 Aug 2008, at 04:11, Jean-Daniel Dupas wrote: Le 28 août 08 à 23:00, Kyle Sluder a écrit : On Thu, Aug 28, 2008 at 12:50 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: It starts with: Just because it *says* it's encoded in UTF-8 doesn't mean it *is*. For all

Re: File Extensions Problem

2008-08-28 Thread Gerriet M. Denkmann
On 28 Aug 2008 11:52:46 -0400, "Michael Ash" <[EMAIL PROTECTED]> wrote: On Wed, Aug 27, 2008 at 6:59 PM, R.L. Grigg <[EMAIL PROTECTED]> wrote: Hmm, I guess the wrinkle in this particular case is if the "contract" doesnt specify something that the programmer assumes to be safe to do (like e

Busy doing nothing

2008-08-29 Thread Gerriet M. Denkmann
I have an app which does not take any Cpu-time when it is doing nothing. So what? you might say. Every app does this. Well, not quite. If I add these magic lines it will use 0.2% of my Cpu just doing nothing: NSMetadataQuery *query = [ [ NSMetadataQuery alloc] init]; [ query

Re: Busy doing nothing

2008-08-29 Thread Gerriet M. Denkmann
On 29 Aug 2008, at 20:57, Phil wrote: On Fri, Aug 29, 2008 at 9:42 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: If I add these magic lines it will use 0.2% of my Cpu just doing nothing: NSMetadataQuery *query = [ [ NSMetadataQuery alloc] init]; [ query star

Re: File Extensions Problem

2008-08-29 Thread Gerriet M. Denkmann
On Fri, 29 Aug 2008 12:13:34 -0400, "Michael Ash" <[EMAIL PROTECTED]> wrote: On Thu, Aug 28, 2008 at 9:50 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: While if fully agree with you about valid assumptions and so, I am still wondering what is the disadvanta

What Size My Window?

2008-09-04 Thread Gerriet M. Denkmann
For an ordinary window one can set in IB "Auto Save Name:" and everything works as expected. I can give it a nice size and position and the next time I open it, all is fine. But if this window is a document, controlled by some NSDocumentController, this Auto Save Name seems to be ingnored

Re: What Size My Window?

2008-09-04 Thread Gerriet M. Denkmann
On 4 Sep 2008, at 15:48, Ken Thomases wrote: On Sep 4, 2008, at 3:10 AM, Gerriet M. Denkmann wrote: For an ordinary window one can set in IB "Auto Save Name:" and everything works as expected. I can give it a nice size and position and the next time I open it, all is fine. B

Re: What Size My Window?

2008-09-04 Thread Gerriet M. Denkmann
On 4 Sep 2008, at 15:49, Uli Kusterer wrote: On 04.09.2008, at 10:10, Gerriet M. Denkmann wrote: 6. Other? So: is there some commonly agreed upon right strategy? Are there some official guidelines for document window sizes? You can save the size of your window in some plist in your

Setting the attributeModDate

2008-09-15 Thread Gerriet M. Denkmann
I am trying to copy a file using NSFilemanagers copyPath:toPath:handler: method. The (Tiger) documentation says: "File or directory attributes—that is, metadata such as owner and group numbers, file permissions, and modification date—are also copied." Well, the attributeModDate is not. S

Re: How to count composed characters in NSString?

2008-09-28 Thread Gerriet M. Denkmann
On Sun, 28 Sep 2008 03:27:48 -0500, Michael Gardner <[EMAIL PROTECTED]> wrote: On Sep 27, 2008, at 2:23 PM, David Niemeijer wrote: Hi, I have been trying to find this in the documentation and list archives but without success so far. What is the best way to count the number of characters i

Re: Adding spaces to an NSString

2008-03-19 Thread Gerriet M. Denkmann
On 19 Mar 2008, at 04:55, [EMAIL PROTECTED] wrote: Yes, I have, Are you thinking insertString:atIndex:? So at a basic level, can I get the string length, for loop through each character and after each use insertString to add a space? No. You may remember that if NSString talks of "charact

Ephemeral Changes

2008-03-25 Thread Gerriet M. Denkmann
I have a document based Cocoa editor, which handles simple text files (setRichText: NO). It handles undo and font changes. But the files are just plain text files; no font information gets stored. So I would like that the document does NOT get dirty (isDocumentEdited) if only the font h

Re: Ephemeral Changes

2008-03-25 Thread Gerriet M. Denkmann
ently NSDocument does, whenever the undo stack changes: document is dirty if and only if size of undo stack > 0 What I want it to do is: document is dirty if and only if number of "real" operations in undo stack > 0. On 26 Mar 2008, at 4:48 am, Gerriet M. Denkmann w

Re: Ephemeral Changes

2008-03-26 Thread Gerriet M. Denkmann
On 26 Mar 2008, at 04:07, Sherm Pendley wrote: On Tue, Mar 25, 2008 at 10:07 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: On 25 Mar 2008, at 23:12, Graham Cox wrote: > There may be a simpler way, but this is what occurred to me when I > read this: > > Subclass NSTex

A Tab after 4 SPACEs

2008-03-27 Thread Gerriet M. Denkmann
I would like to put an NSLeftTabStopType after every 4 blanks (' ' Unicode: SPACE) into my NSTextField. So I do: NSFont *usedFont = [ layoutManager substituteFontForFont: font ]; float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; and so on. Works perfectly for Monaco

Re: Ephemeral Changes

2008-03-27 Thread Gerriet M. Denkmann
On 26 Mar 2008, at 22:56, Graham Cox wrote: The undo manager will directly change the data in the text view using an invocation or target/action - it doesn't go back through changeFont: normally, which is really a "high level" method. Maybe the solution to this is to subclass NSUndoManager

Re: A Tab after 4 SPACEs

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 10:08, Uli Kusterer wrote: On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think an NSGlyph can be generated b

Re: Ephemeral Changes

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 09:50, Jens Miltner wrote: Am 26.03.2008 um 11:26 schrieb Gerriet M. Denkmann: I also can use Edit ► Undo Set (or Paste) Font but now the document gets dirty. Very bad. Also: the complete text gets selected. So what else do I have to implement? I tried setFont: and

Re: Ephemeral Changes

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 14:46, Jens Miltner wrote: Am 27.03.2008 um 11:57 schrieb Gerriet M. Denkmann: On 26 Mar 2008, at 22:56, Graham Cox wrote: The undo manager will directly change the data in the text view using an invocation or target/action - it doesn't go back through chang

Re: A Tab after 4 SPACEs

2008-03-28 Thread Gerriet M. Denkmann
On 28 Mar 2008, at 00:53, Alastair Houghton wrote: On 27 Mar 2008, at 16:12, Gerriet M. Denkmann wrote: Current I am using: NSString *dummyString = [ NSString stringWithUTF8String: " " ]; NSTextView *dummyTextView = [ [ NSTextView alloc ] initWithFrame: NSMakeRect(0

<    2   3   4   5   6   7   8   9   10   11   >