Keys dependent on NSArrayController's selection

2008-05-07 Thread Dave Dribin
Hi All, I feel like I'm missing something basic here. Say I have a table bound to an array controller. And also say that each item in the array controller is a Person with firstName and lastName properties. Now say, I want to have a button that is only enabled when a Person with last n

Re: Keys dependent on NSArrayController's selection

2008-05-07 Thread Dave Dribin
On May 7, 2008, at 6:58 PM, Sean McBride wrote: Have you put a breakpoint in 'canEnableButton'? When 'peopleController.selectionIndexes' changes, do you hit the breakpoint? I suspect not. Nope. Well, it does get called once at app startup, but not as the selection changes. The docs fo

Re: Keys dependent on NSArrayController's selection

2008-05-08 Thread Dave Dribin
On May 8, 2008, at 9:22 AM, Sean McBride wrote: On 5/8/08 1:53 AM, Dave Dribin said: For kicks, I did try "peopleController.selectionIndex" as well as "peopleController.selectedObjects" to no avail. So it seems you have observed the same as I: that keyPathsForValuesAffec

Re: F-Script Anywhere can't add to procmod group

2008-05-08 Thread Dave Dribin
On May 8, 2008, at 7:31 PM, David Carlisle wrote: I'm trying to install F-Script Anywhere, but it can't install my developer account into the procmod group. It says "not a known DirStatus." I don't speak Unix, but I tried finding some terminal commands on the internet for installing a user

Re: F-Script Anywhere can't add to procmod group

2008-05-08 Thread Dave Dribin
On May 8, 2008, at 7:53 PM, David Carlisle wrote: My file directory name says "FScriptBin-20070421" My startup warning message says I got it Jan 8, 2008, from www.fscript.org. I think you may have to downgrade to Robert's FSA 1.3.1 as it looks like the code signing stuff hasn't made it into

Re: Can I use NSString classes SYNCHRONOUSLY?

2008-05-14 Thread Dave Dribin
On May 14, 2008, at 10:22 AM, [EMAIL PROTECTED] wrote: I'm reading up on NSStream; where delegation is used for Asynchronous process. However, I need Synchronous processing. NSInputStream isn't asynchronous + delegate for reading (are you confusing it with another class?), but it's still a

Re: Can I use NSString classes SYNCHRONOUSLY?

2008-05-14 Thread Dave Dribin
On May 14, 2008, at 5:11 PM, Jens Alfke wrote: On 14 May '08, at 10:03 AM, [EMAIL PROTECTED] wrote: Essentially I want to mimic the Java HTTPConnect example I gave. I also want to be able to change the request property to POST, as in the Java equivalent: connection.setRequestMethod(HttpConnect

Re: KVO notifications and threads

2008-07-14 Thread Dave Dribin
On Jul 11, 2008, at 2:36 PM, Bill Bumgarner wrote: If you have specific enhancement requests, please file a bug via http://bugreporter.apple.com . If your request is "make MVC and KVO play nicely with threads", you will need to provide details on exactly what you mean -- exactly how that is

Re: KVO notifications and threads

2008-07-18 Thread Dave Dribin
On Jul 14, 2008, at 10:59 PM, Ron Lue-Sang wrote: The argument I'm trying to make is that you, as the app implementor, have everything you need to do what you mean and do it correctly. Imagine this (this is kinda long winded, so buckle up): - You have a view bound to property foo of DataObjec

Re: Thread ID in crash log

2008-12-17 Thread Dave Dribin
On Dec 17, 2008, at 7:37 PM, radj wrote: I see. I'm not trying to be ungrateful (because I really am, thanks for the code), but calling CrashLogThreadID(pthread_t) might be too costly for every call to my custom debugLog(...) because there are alot all over the code (not the best practice,

Re: Thread ID in crash log

2008-12-17 Thread Dave Dribin
On Dec 17, 2008, at 10:11 PM, Greg Parker wrote: Of course, if the number of threads changes then that cached thread ID may not match the crash log anymore. (And the number of threads in your process may change due to code outside your control.) Ah, right. Never mind. :) -Dave ___

Re: @loader_path and @executable_path

2009-01-12 Thread Dave Dribin
On Jan 12, 2009, at 10:47 AM, Joseph Crawford wrote: I do not know if this is a cocoa question or not, it is an error I get when I hit build & go This GDB was configured as "i386-apple-darwin".tty /dev/ttys001 warning: Unable to read symbols for "@loader_path/../Frameworks/ BWToolkitFramework

Re: @loader_path and @executable_path

2009-01-12 Thread Dave Dribin
On Jan 12, 2009, at 2:12 PM, Joseph Crawford wrote: I figured out that issuing this command in terminal fixed the issue for this project. install_name_tool -change "@loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle" "@executable_path/../ Frameworks/Sparkle.framework/Versions

Re: @loader_path and @executable_path

2009-01-12 Thread Dave Dribin
On Jan 12, 2009, at 4:58 PM, Brandon Walkin wrote: I'm the developer of BWToolkit. Some users have run into this problem where the framework would work fine for them for a while, and then one day it would output the warnings that Joseph mentioned. My Xcode/gcc knowledge is a bit lacking, so

Re: @loader_path and @executable_path

2009-01-12 Thread Dave Dribin
On Jan 12, 2009, at 6:33 PM, Dave Dribin wrote: Upon further investigation, the error "(file not found)" seems to imply that it can't find the file, which is clearly not the correct error message. Furthermore, I took a quick glance at the gdb sources [1], and noticed that i

NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-19 Thread Dave Dribin
Hello, When I hit the "Delete" key in one of my table views, I get the following error logged to the console: Object is not usable with binder of class NSTextValueBinder I also don't get the typical "Beep" that happens when a key press goes off the end of the responder chain. What doe

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-19 Thread Dave Dribin
On Aug 19, 2008, at 3:27 PM, Dave Dribin wrote: Hello, When I hit the "Delete" key in one of my table views, I get the following error logged to the console: Object is not usable with binder of class NSTextValueBinder Further information: I have one column with a custom NSCel

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-19 Thread Dave Dribin
On Aug 19, 2008, at 5:19 PM, Corbin Dunn wrote: You can in IB3; just double click on the cell...then set the class. It's not letting me set it to my custom cell. It just beeps (IB version 3.1, build 670). I think this is because the column is setup a text field cell, and it will only let

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-19 Thread Dave Dribin
On Aug 19, 2008, at 7:03 PM, Corbin Dunn wrote: It's not letting me set it to my custom cell. It just beeps (IB version 3.1, build 670). I think this is because the column is setup a text field cell, and it will only let me set the class to an NSTextFieldCell subclass. There's no plain NS

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-19 Thread Dave Dribin
On Aug 19, 2008, at 5:47 PM, Dave Dribin wrote: Again, what's strange is if I change my cell's superclass to be NSTextFieldCell, this bind: call does not give an error and it all works. I also tried subclassing NSActionCell, and that works, too. Is my cell not implementing s

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Dave Dribin
On Aug 19, 2008, at 10:51 PM, Dave Dribin wrote: On Aug 19, 2008, at 5:47 PM, Dave Dribin wrote: Again, what's strange is if I change my cell's superclass to be NSTextFieldCell, this bind: call does not give an error and it all works. I also tried subclassing NSActionCell, and

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-20 Thread Dave Dribin
On Aug 20, 2008, at 3:35 AM, Ken Ferry wrote: FYI, you should avoid using direct subclasses of NSCell in controls on Leopard and previous. Well, that settles that, then. ;) It's somewhat unfortunate, but there are many cases where messages need to flow from a cell up to a view. If your cell

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-21 Thread Dave Dribin
On Aug 21, 2008, at 12:45 AM, Ken Ferry wrote: The NSTextValueBinder error message is a bug? Or the fact that NSCell does not have a "value" binding? Or both? ;) Maybe both.. I meant the first. Well, more information. I found the code that was directly responsible for causing the error

Re: NSString and special characters

2008-08-22 Thread Dave Dribin
On Aug 22, 2008, at 3:39 AM, Bill Bumgarner wrote: Have you read this book? http://tinyurl.com/6kxxgc And it's even available online, now: -Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-26 Thread Dave Dribin
On Aug 21, 2008, at 12:45 AM, Ken Ferry wrote: The NSTextValueBinder error message is a bug? Or the fact that NSCell does not have a "value" binding? Or both? ;) Maybe both.. I meant the first. I just filed three bugs: rdar://problem/6178538 infoForBinding:@"value" on an NSTableColumn l

Re: NSTableColumn not usable with binder of class NSTextValueBinder?

2008-08-29 Thread Dave Dribin
On Aug 27, 2008, at 1:34 AM, Ron Lue-Sang wrote: Woah. If you really want to use a custom cell, you're gonna want a custom column as well. The bindings for the tableColumn come from the tableColumn's dataCell's available bindings. Yea, as you've found, NSActionCell has a value binding, not

What to use observeValueForKeyPath: context

2008-08-29 Thread Dave Dribin
Hi all, It seems that KVO best practice is to use the "context" in observeValueForKeyPath:ofObject:change:context: to differentiate between different key paths, rather than check key path strings for equality. Since context is a void *, it also seems best practice to just use some unique

Re: What to use observeValueForKeyPath: context

2008-08-29 Thread Dave Dribin
On Aug 29, 2008, at 10:03 AM, Phil wrote: On Sat, Aug 30, 2008 at 2:56 AM, Dave Dribin <[EMAIL PROTECTED]> wrote: Is there some benefit to using number values over string constants, or is it just stylistic differences? Using NSStrings (or any other object) will work fine, but com

Re: What to use observeValueForKeyPath: context

2008-08-29 Thread Dave Dribin
On Aug 29, 2008, at 11:27 AM, Michael Ash wrote: This (void *)1091 business seems highly dangerous to me. After all, what prevents somebody else from using 1091 too? If everybody uses a pointer value that's guaranteed to be unique (like a unique string literal) then you know you're safe. It rea

Re: What to use observeValueForKeyPath: context

2008-08-29 Thread Dave Dribin
On Aug 29, 2008, at 12:23 PM, j o a r wrote: The penalty for using constant strings is that they will end up wasting space in your binary... Rons suggestion is probably optimal. I'm definitely leaning towards that way, now. Though I may combine both for debugging. static NSString *Proper

Re: Bindings: Specifying the Class of a Con troller’s Content

2008-08-29 Thread Dave Dribin
On Aug 29, 2008, at 12:38 PM, Oleg Krupnov wrote: My question is: what is a real example of a case when the controller needs to create new content objects? -[NSArrayController add:] ? You can use that as an action for a button in IB. -Dave ___ C

Re: What to use observeValueForKeyPath: context

2008-08-29 Thread Dave Dribin
On Aug 29, 2008, at 12:35 PM, Dave Dribin wrote: On Aug 29, 2008, at 12:23 PM, j o a r wrote: The penalty for using constant strings is that they will end up wasting space in your binary... Rons suggestion is probably optimal. I'm definitely leaning towards that way, now. Though

Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
Hello, Is it safe to use -[NSApplication targetForAction:] with non-action selectors? For example, selectors that have more than one argument, non-id first argument, or return values? The documentation for targetForAction:to:from: seems to imply it just does a respondsToSelector: on each

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
On Sep 15, 2008, at 6:30 PM, Julien Jalon wrote: It's not safe... once the target is found (using respondsToSelector:, you're right), the action is performed with: [target performSelector:actionSelector withObject:sender]; which means that anything but an object as a sender will potentially

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
On Sep 15, 2008, at 6:35 PM, Graham Cox wrote: What exactly are you trying to do? I'd say it's not safe, since that usage isn't anticipated, or necessary. If you could perhaps outline why you think you need it a better solution can be suggested. I've got, say, an info panel that needs to d

Re: Abusing targetForAction: with non-action selectors

2008-09-15 Thread Dave Dribin
On Sep 15, 2008, at 6:56 PM, Graham Cox wrote: I think you have this a bit backwards, possibly. You still have to get notified when the first responder changes in order to tell your info panel to reorganise itself, so why not use that notification to directly obtain the correct target? Objec

Poking an NSRunLoop with an NSMachPort

2008-09-18 Thread Dave Dribin
Hello, I'm trying to figure out how to get a blocking call to -[NSRunLoop runMode:beforeDate:] to return. It seems the best way to do this is to use a "real" (non-timer) input source to poke the run loop, as mentioned by Chris Kane in this post:

Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Dave Dribin
On Sep 24, 2008, at 3:35 PM, Jason Bobier wrote: Thanks Nick. I'm trying to avoid polling tho (since that is the whole point of runloops and mach ports). Take a look a message I posted a few days ago that uses a Mach port to wake up the run loop:

Re: How to set up a thread listening to performSelector: messages?

2008-09-25 Thread Dave Dribin
On Sep 25, 2008, at 10:53 AM, Oleg Krupnov wrote: Then from the main thread I send: [[worker runLoop] performSelector:@selector(processRequest:) target:worker argument:request order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; You cannot do this. NSRunLoop is not thread safe and t

Re: NSManagedObject subclass accessor pattern mystery?

2008-09-29 Thread Dave Dribin
On Sep 29, 2008, at 11:44 PM, Michael B Johnson wrote: So I have a CoreData app (10.5.5, 64 bit only) that has a NSManagedObject that has an NSColor* that is part of its data model. Because this color is actually a computed value that we want to cache, it is declared as a property: Have

Multiple persistent store coordinators gotchas?

2008-10-15 Thread Dave Dribin
Hello, I'm working on a Core Data application that does lots of processing of the data in background threads to generate reports. I'd like to investigate using multiple persistent store coordinators to reduce lock contention, i.e. pattern #2, as described in the multi-threaded chapter of

Re: Multiple persistent store coordinators gotchas?

2008-10-15 Thread Dave Dribin
On Oct 15, 2008, at 5:52 PM, Melissa J. Turner wrote: If your second thread is doing pure report generation, and whatever transients it sets won't affect anything outside the report generation, this is the solution you're looking for. Great, thanks! The documentation is a little thin about

Re: Multiple persistent store coordinators gotchas?

2008-10-16 Thread Dave Dribin
Hi Melissa, Thanks for your help. A quick question on this stale data statement: On Oct 15, 2008, at 5:52 PM, Melissa J. Turner wrote: Stale data is unlikely to be a problem unless you're expecting to load it significantly before you actually need it, which would be the same if you were loa

Re: Multiple persistent store coordinators gotchas?

2008-10-17 Thread Dave Dribin
On Oct 16, 2008, at 3:59 PM, Dave Dribin wrote: On Oct 15, 2008, at 5:52 PM, Melissa J. Turner wrote: Stale data is unlikely to be a problem unless you're expecting to load it significantly before you actually need it, which would be the same if you were loading it into a separate conte

Re: NSInMemoryStoreType: Not really "persistent", is it?

2008-10-22 Thread Dave Dribin
On Oct 21, 2008, at 6:53 PM, Bill Bumgarner wrote: The in memory store is actually extremely useful for caches and as a backing store for applications that read/write to/from some kind of server -- typically an XML RPC of some type -- that wants to take full advantage of CD's object graph ma

Re: NSService - I need a headslap

2009-02-04 Thread Dave Dribin
On Feb 4, 2009, at 2:37 PM, Peter Ammon wrote: On Tiger and earlier, there is no way to avoid needing to log in and out. On Leopard, you can use the function NSUpdateDynamicServices() to immediately scan for new Services. If you're just testing, a quick way to scan for new Services is to r