Re: Global HotKey

2011-02-09 Thread Dave DeLong
On Feb 8, 2011, at 11:20 PM, Andy Lee ag...@mac.com wrote: On Feb 9, 2011, at 12:56 AM, Daniel Ketel wrote: Looks like I have to use Carbon and hope Apple will continue to support it. Thank you for your help. You might be interested in Dave DeLong's Objective-C wrapper, called DDHotKey:

Re: CoreData Migration Problems

2011-02-09 Thread Felix Franz
On Feb 8, 2011, at 9:08 PM, Gordon Apple wrote: I am trying to migrate an existing app CoreData database to a new version. Theoretically, this should be what's called a simple migration. I have not been able to get it to work. Just to see what it's trying to do, I went ahead and let it

Re: Global HotKey

2011-02-09 Thread Daniel Ketel
Hi, Well, Dave, if you say so ;) I'll take a look at the code. Thanks to everybody who helped! Best Regards, Daniel Ketel On Feb 9, 2011, at 09:54, Dave DeLong wrote: On Feb 8, 2011, at 11:20 PM, Andy Lee ag...@mac.com wrote: On Feb 9, 2011, at 12:56 AM, Daniel Ketel wrote: Looks like I

Re: UILabel contentView is 'left' out of IB but the default should be 'redraw'

2011-02-09 Thread Roland King
Thanks for both your answers to my questions today David. I'll file a docs bug on the UILabel and if I have time to distill out a small test case for the resizing I'll file that too, I'm not quite sure what a UILabel should do if it's set to 'left' and is resized, but I think it should do the

Get ProcessSerialNumber of last front application

2011-02-09 Thread Mr. Gecko
Hello, I am wondering how I can get the last front application ProcessSerialNumber so I can use SetFrontProcess to bring it back to front after they close the window to my application. My application is a UIAgent so it doesn't have a dock icon and I am thinking that the user would like it more

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Dave DeLong
Alternative: instead of bringing another process forwards, tell yours to hide. Then the previously-frontmost app will be frontmost again. Dave Sent from my iPhone On Feb 9, 2011, at 7:23 AM, Mr. Gecko grmrge...@gmail.com wrote: Hello, I am wondering how I can get the last front application

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Mr. Gecko
I guess I can do that. I'll give it a try. On Feb 9, 2011, at 10:21 AM, Dave DeLong wrote: Alternative: instead of bringing another process forwards, tell yours to hide. Then the previously-frontmost app will be frontmost again. Dave Sent from my iPhone smime.p7s Description: S/MIME

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Peter Lübke
GetNextProcess() doesn't reflect the order in which processes were made front, as the Process Manager doc says: Note that the order of the list of processes is internal to the Process Manager which *seems* to be the order in which processes register with Process Manager; if this is true (I

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Mr. Gecko
I'm looking for the process that was front before my application became front. I was thinking in getting the process as this is what I did in my menubar applications and I just stole code from them. I can do as Dave DeLong said and hide the application using [[NSApplication sharedApplication]

indeterminate progress bar animation and CALayer-backed sibling view

2011-02-09 Thread Michael Hanna
Hi all. I have a sheet which has a horizontal progress bar, and two Core Animation backed views. The sequence of events are as such: 1 progress bar animates indeterminate 2 CALayer-backed view animates 3 progress bar animates determinate 4 CALayer-backed view stops animating 5 progress bar

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Matt Neuburg
On Tue, 8 Feb 2011 17:07:00 -0600, Fritz Anderson fri...@manoverboard.org said: On 8 Feb 2011, at 2:51 PM, Quincey Morris wrote: P.S. It's OT, but initializing 'error' to nil before passing it to an error-returning method is both a waste of time and semantically incorrect -- it's an *output

Re: CATransformLayer doesn't support implicit animation?

2011-02-09 Thread David Duncan
On Feb 7, 2011, at 9:43 PM, Indragie Karunaratne wrote: I'm trying to animate a CATransformLayer (the transform layer is a sublayer of the layer of a layer hosting NSView). Here's my animation code: self.transformLayer is a CATransformLayer with two sublayers, one for the front and one

Re: indeterminate progress bar animation and CALayer-backed sibling view

2011-02-09 Thread Quincey Morris
On Feb 9, 2011, at 08:52, Michael Hanna wrote: In stage 1, the progress bar won't animate as indeterminate(barber pole) unless I set -usesThreadedAnimation:YES. After the CALayer backed view animates in stage 2, the progress bar never animates indeterminately in stage 5.

Cocoaheads at Ozate TONIGHT, 2/9. Note different location!

2011-02-09 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the month. In January and February, we will be meeting at Ozate, 22921 Triton Way, Suite 124, Laguna Hills, CA 92653, before returning to our usual location. Come on by and check out Joe's new digs. Please join us from 7pm to

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Quincey Morris
On Feb 9, 2011, at 09:09, Matt Neuburg wrote: From Bill Bumgarner: If the method fails -- if file is nil -- the 'error' will be filled in with an [autoreleased] NSError instance describing the error. However, 'enc' will be undefined. If the method succeeds, file and enc will be

Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Matt Neuburg
Date: Tue, 8 Feb 2011 17:07:00 -0600 From: Fritz Anderson fri...@manoverboard.org Subject: Initializing NSError **, again Re: CoreData Migration Problems I'm filing a bug against the documentation because it's flat wrong; or if it's right, it's a workaround for a bug, and the

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Matt Neuburg
On Wed, 9 Feb 2011 09:23:45 -0600, Mr. Gecko grmrge...@gmail.com said: Hello, I am wondering how I can get the last front application ProcessSerialNumber so I can use SetFrontProcess to bring it back to front after they close the window to my application. You can track applications as they come

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Scott Anguish
If you pass blah, if there is no error, blah == nil Perhaps by-reference would be a better terminology. Returns, by-reference, an NSError object if the regex is invalid; otherwise nil. Pass nil if you don't care. Would that be preferable to folks? Sent from my iPhone On Feb 9, 2011, at 1:51

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Mr. Gecko
The only question I would have is if I were to track the applications all the time, how much time on the processor would it require, would it 1. require enough that will slow down the user noticeably, or 2. would it be like just 0.1% of cpu in a few milliseconds. I try to be considerate of the

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Jean-Daniel Dupas
Carbon events are events. As long as you don't receive one, your app is waiting consuming 0% of the CPU. Le 9 févr. 2011 à 20:05, Mr. Gecko a écrit : The only question I would have is if I were to track the applications all the time, how much time on the processor would it require, would it

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Mark Munz
In 10.6 or later, if you do need to know when apps are being activated, you can also uses the NSWorkspace notificationCenter and observe NSWorkspaceDidActivateApplicationNotification with something like this: [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Matt Neuburg
On Feb 9, 2011, at 11:19 AM, Bill Bumgarner wrote: On Feb 9, 2011, at 10:51 AM, Matt Neuburg wrote: error An out value that returns any error encountered during initialization. Returns nil if the regular expression pattern is invalid. Really? :) m. I read that as The method

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Matt Neuburg
You're optimizing prematurely. Try it and see! m. On Feb 9, 2011, at 11:05 AM, Mr. Gecko wrote: The only question I would have is if I were to track the applications all the time, how much time on the processor would it require, would it 1. require enough that will slow down the user

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Greg Parker
On Feb 9, 2011, at 10:34 AM, Quincey Morris wrote: The real world cost in all of this is that it's easy for a developer to misunderstand the 'error:' parameter mechanism, in such a way as to code an error handling scheme that depends on initialization to a nil value to work properly.

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Wim Lewis
On 9 Feb 2011, at 11:04 AM, Scott Anguish wrote: If you pass blah, if there is no error, blah == nil Perhaps by-reference would be a better terminology. Returns, by-reference, an NSError object if the regex is invalid; otherwise nil. Pass nil if you don't care. My understanding is that

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Greg Parker
On Feb 9, 2011, at 2:02 PM, Wim Lewis wrote: 3. If the method succeeds, it will not modify *error. This is incorrect, I think. If the method succeeds, then *error may or may not have been modified. (The documentation also regularly confuses nil, NULL, and NIL.) nil and Nil and NULL are

Re: Core Data, NSTableView, Bindings, in code update problem

2011-02-09 Thread Jerry Krinock
On 2011 Feb 09, at 15:22, Darren Wheatley wrote: I have some code that does this update [update the values in the data inspector panel], but the changes are not mirrored in the main NSTableView, and are also not saved to the Core Data store. I think that what you call a data inspector is

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Quincey Morris
On Feb 9, 2011, at 12:46, Greg Parker wrote: Initializing the error to nil is helpful to protect against one nasty hole in the pattern. Consider this code: NSError *error; id result = [receiver doSomethingWithError:error]; if (!result) NSLog(@error %@, error); On failure,

NSSearchfield help

2011-02-09 Thread lorenzo7620
I have a NSTableView populated by an NSArrayController. Above the table, I have an NSToolbar, to which I would like add the ability to search. I have found a couple of examples of implementing search using an NSSearchField, but the two that I have found both display the results in a dropdown

NSOutlineView + NSButtonCell weird bug

2011-02-09 Thread Graham Cox
I've had this problem show up sporadically for some time, but now I can't get rid of it. I have an NSOutlineView with several columns, two of which have checkbox behaviour. In these columns I set a NSButtonCell in IB having the checkbox behaviour, and in fact I want to have custom images

Abstract Text Example and Question

2011-02-09 Thread Brad Stone
I made this code to remove any duplicate words from a large group of text. The result is stored in an index file so the text doesn't need to make sense. I'm removing the duplicates to save space in the index file. I was wondering if anyone had a suggestion for a more efficient way to

Re: Abstract Text Example and Question

2011-02-09 Thread Graham Cox
Using LZW or similar compression is likely to give you substantially better file compression, if that's what you're after. Of course you'd have to re-expand it to use it. The killer here I would guess is the use of [NSArray indexOfObject:] - it has to perform a string-by-string linear search

Re: NSOutlineView + NSButtonCell weird bug

2011-02-09 Thread Graham Cox
OK, I think I found the reason for the problem. I'm using the generally excellent BWToolkit in my app, but it has some issues. One of these is that the version I'm using completely breaks nib decoding by brute-force switching out the standard NSButtonCell class for the unarchiver. That's just

document types question

2011-02-09 Thread Rick C.
Hello, In my project's Info.plist I have included numerous extensions under Document types so that my app will open these kinds of files. Now I know this adds my app to the Open With contextual menu item in Finder, but I was told my app is also somehow making itself the default app for these

Re: document types question

2011-02-09 Thread Ken Thomases
On Feb 9, 2011, at 9:36 PM, Rick C. wrote: In my project's Info.plist I have included numerous extensions under Document types so that my app will open these kinds of files. Now I know this adds my app to the Open With contextual menu item in Finder, but I was told my app is also somehow