Really strange NSTableView issue

2011-07-15 Thread Gideon King
I have a table view which uses an array controller for the contents, and as a data source and delegate so I can do drag and drop etc. It displays my data (Colors) just fine, but in one particular scenario something somewhere is over-releasing an NSIndexSet. I have stripped it right back to the

Re: Really strange NSTableView issue

2011-07-15 Thread Gideon King
OK, as usual, 10 minutes after sending the email to the list, something new turns up. The *only* time that this problem occurs is when the drag source is the table view in the Color Palettes section of the Color panel. Still no idea what's causing it, but at least the problem is narrowed down.

Re: Really strange NSTableView issue

2011-07-15 Thread Quincey Morris
On Jul 15, 2011, at 01:40, Gideon King wrote: - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndices toPasteboard:(NSPasteboard *)pboard { return YES; } This looks suspicious, because it's asking you to write specific rows to the pasteboard, and you

Re: Really strange NSTableView issue

2011-07-15 Thread Gideon King
In my normal code I do write the date etc, and I only added the clear contents afterwards to try to track down the issue. In the process of testing, it became clear that it made absolutely no difference to the results whether I had anything happening in those methods or not - the process was

Re: model key path and properties

2011-07-15 Thread Torsten Curdt
The popup button's Content binding is an *entire* array. So you are saying it should be rather Content Values instead? Arrays don't have a name property. IOW, arrangedObjects.name is not a valid key path. The strange thing - ignoring the warning it just worked. So I am a little puzzled.

Re: model key path and properties

2011-07-15 Thread Quincey Morris
On Jul 15, 2011, at 02:44, Torsten Curdt wrote: So you are saying it should be rather Content Values instead? No, I can never remember which of NSPopUpButton's multitudinous binding is the correct one to use. (That's one reason I don't bother with bindings for this class. By the time I've

Hooking into responder chain, and NSTabViews - or dont?

2011-07-15 Thread Mirabito, David
Hello, [re-sending: previous attempt yesterday sent from a non-subscribed email account. Sorry in advance if it dupes!] I have a custom view (DJMTerminalView) and a controller object (DJMTerminal) with the idea being that the view is only responsible for drawing (draw char foo at position bar

Re: Core Data search optimizations

2011-07-15 Thread Indragie Karunaratne
The mailing list really isn't a place to advertise your products and my question was specifically in regards to Core Data. I'm not interested in alternate database frameworks. On 2011-07-15, at 2:36 AM, Ruslan Zasukhin wrote: On 7/15/11 1:59 AM, Indragie Karunaratne cocoa...@indragie.com

Re: Hooking into responder chain, and NSTabViews - or dont?

2011-07-15 Thread Raleigh Ledet
Hi David, As you switch views due to tab switching, the newly added view sets up it's next responder based on the view hierarchy. The new view coming in doesn't know anything about your view controller and simply wires up it's newt responder as it's parent view. You have a few options here:

CFString literal contains NUL character

2011-07-15 Thread Gerriet M. Denkmann
I convert a file into a string: NSFileHandle *fh = [ [ NSFileHandle alloc ] initWithFileDescriptor: fileDescriptor ]; NSData *data = [ fh readDataToEndOfFile ]; [ fh release ]; NSString *uu = [ [ NSString alloc ] initWithData: data encoding: NSUTF8StringEncoding

Memory management and returned values from methods...

2011-07-15 Thread Kevin Muldoon
Hey guys, I know of at least one way to fix this memory leak but I'm hoping to find a few more ways. I'm chewing through a text file of 205,960 lines in a C while loop. All is good until MyObject returns a value. Of course the return value set to autorelease (Well, I suppose it would

Re: Memory management and returned values from methods...

2011-07-15 Thread David Duncan
On Jul 15, 2011, at 12:38 PM, Kevin Muldoon wrote: while (fgets(buffer, sizeof(buffer), filePointer) != NULL) { NSString *line = [[NSString alloc] initWithString:[NSString stringWithFormat:@%s, buffer]]; You could use -[NSString initWithUTF8String:] instead.

Re: Memory management and returned values from methods...

2011-07-15 Thread Hank Heijink (Mailinglists)
On Jul 15, 2011, at 3:38 PM, Kevin Muldoon wrote: Hey guys, I know of at least one way to fix this memory leak but I'm hoping to find a few more ways. I'm chewing through a text file of 205,960 lines in a C while loop. All is good until MyObject returns a value. Of course the return

Re: Memory management and returned values from methods...

2011-07-15 Thread Scott Ribe
On Jul 15, 2011, at 1:38 PM, Kevin Muldoon wrote: However, there must be a better way than giving up control of releasing my objects to NSAutoreleasePool. How is this giving up control? There's always an NSAutoreleasePool provided by the run loop which cleans up between handling events; all

Re: CFString literal contains NUL character

2011-07-15 Thread Jens Alfke
On Jul 15, 2011, at 12:27 PM, Gerriet M. Denkmann wrote: and get a warning: CFString literal contains NUL character. 10.6.8, LLVM 2.0, Xcode 4.0.2 How do I get rid of this warning? Create the separator string programmatically, I suppose. -initWithCharacters:length: would work. But it

Re: Memory management and returned values from methods...

2011-07-15 Thread Kevin Muldoon
You make a very compelling point. On Jul 15, 2011, at 4:36 PM, Scott Ribe wrote: On Jul 15, 2011, at 1:38 PM, Kevin Muldoon wrote: However, there must be a better way than giving up control of releasing my objects to NSAutoreleasePool. How is this giving up control? There's always an

Localizing Keychain names

2011-07-15 Thread Sean Leonard
Howdy folks, I am looking to add a new Keychain for an app that I am building. I noticed that in Keychain Access and in the system dialog boxes, the three special keychains login, System, and System Roots have localized names. In Japanese, for example, these keychains get named ロ グイン, システム,

Re: What could cause an NSAlert to not dismiss on a button press?

2011-07-15 Thread Jerry Krinock
On 2011 Jul 13, at 05:58, Graham Westlake wrote: I'm showing an NSAlert with runModal, but despite the buttons being responsive, the alert box will not dismiss and runModal never returns. I can't understand what state the run loop is in for this to be happening. This doesn't quite make