Re: CGEventTap Not Receiving Events after some time

2010-09-30 Thread Bill Cheeseman
On Sep 29, 2010, at 3:52 PM, Erik Aigner wrote: > When I create an event tap with CGEventTapCreate(..) and add it to the > runloop everything works as expected. > However, after some time (I don't know what triggers this) the event tap > doesn't receive events anymore, until > I manually call

Re: Button performs action and then stores result to a binding?

2010-09-30 Thread Jonny Taylor
Thanks for your replies Ken. >> I have a modal dialog which, among other things, contains a number of file >> paths. There are "set..." buttons to set which files these are pointing to. > You should probably by using NSPathControl instead of displaying paths and > having "set" buttons. Ah, I had

Re: CGEventTap Not Receiving Events after some time

2010-09-30 Thread Erik Aigner
I already check for these events, but they never occur. I think it might be that some other app inserts itself again before my (active, not listen only) tap? The event tap specifically taps system events for the media keys previous/playpause/next. I guess the new iTunes version probably "reconqu

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-30 Thread Oleg Krupnov
Hi Ken, I understand that you probably cannot help me any further, but just in case I am reporting the following, if anyone knows a solution or can benefit from the information I have checked the mailing archives and it seems that I am not alone with the problem that runInNewThread does not neces

Should I use NSDocument, NSUserDefaults or something else

2010-09-30 Thread Jonny Taylor
Thankyou for peoples patience with my recent very basic conceptual cocoa questions. I have another where I am trying to understand the best way of handling some persistent data storage. My app is a workstation for a type of microscope, which from the point of view of the software consists of se

Re: CGEventTap Not Receiving Events after some time

2010-09-30 Thread Bill Cheeseman
On Sep 30, 2010, at 6:28 AM, Erik Aigner wrote: > I already check for these events, but they never occur. I think it might be > that some other > app inserts itself again before my (active, not listen only) tap? > > The event tap specifically taps system events for the media keys > previous/pl

Re: Should I use NSDocument, NSUserDefaults or something else

2010-09-30 Thread Angus Hardie
On 30 Sep 2010, at 12:42, Jonny Taylor wrote: > My app is a workstation for a type of microscope, which from the point of > view of the software consists of several different video cameras and some > other devices controlled over USB. Each camera has associated settings (e.g. > exposure) that

Exceptions to the "don't use -[NSManagedObject dealloc]" rule?

2010-09-30 Thread Jonathan del Strother
Hi, I'm in the process of converting an existing iPhone app to use Core Data for its backend storage. I've got a model that manages an upload of its own attributes to a server - it has a retained NSURLConnection instance variable. Traditionally, I'd just release the connection in the model's dea

Re: CGEventTap Not Receiving Events after some time

2010-09-30 Thread Erik Aigner
No, i figured out. It was some code in the callback that prevented me from identifying a timeout message (wasn't easy recognizable on the first look). Regards, Erik On 30.09.2010, at 14:49, Bill Cheeseman wrote: > > On Sep 30, 2010, at 6:28 AM, Erik Aigner wrote: > >> I already check for thes

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-30 Thread Ken Thomases
On Sep 30, 2010, at 6:21 AM, Oleg Krupnov wrote: > I have checked the mailing archives and it seems that I am not alone > with the problem that runInNewThread does not necessarily cause the > request to be processed in the new thread. Some folks report that > -removeRunLoop helped them, but my exp

NSOperation -dealloc not called

2010-09-30 Thread Andreas Grosam
I've subclassed a NSOperation and declared a completion block in the initializer as follows: - (id) initWithParameter:(id)parameter { self = [super init]; if (self != nil) { [self setCompletionBlock:^{ NSLog(@"operation completed"); [someIvar release], someIva

Re: Exceptions to the "don't use -[NSManagedObject dealloc]" rule?

2010-09-30 Thread Dave DeLong
I'd probably set the managed object as the delegate of your URL connection. NSURLConnection retains its delegate, and NSURLConnection is itself retained by the run loop, so you don't have to worry about the managed object disappearing from underneath you. Then you can simply clean up the conne

Re: NSOperation -dealloc not called

2010-09-30 Thread Dave DeLong
By referencing instance variables within the block, you're causing the block to retain self, and since self retains (copy'd) the block, you've got a retain cycle. The easiest way to fix this is to break the retain cycle yourself. Doing "[self setCompletionBlock:nil];" at the end of the block s

Re: NSOperation -dealloc not called

2010-09-30 Thread Andreas Grosam
Setting the block to nil within the block itself actually did the trick. Thank you very much for the quick reply and the correct solution! :) Andreas On Sep 30, 2010, at 5:21 PM, Dave DeLong wrote: > By referencing instance variables within the block, you're causing the block > to retain se

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-30 Thread Ken Thomases
On Sep 30, 2010, at 11:17 AM, Oleg Krupnov wrote: > NSSocketPort* port = [[NSSocketPort alloc] initWithTCPPort:1234]; > NSConnection* connectionPoint = [[NSConnection alloc] > initWithReceivePort:port sendPort:nil]; > if ([connectionPoint registerName:CONNECTION_NAME > withNameServer:[NSSocketPort

RE: Should I use NSDocument, NSUserDefaults or something else

2010-09-30 Thread Shawn Bakhtiar
Have you looked at the sample code for NSUserDefaults ? I think this IS the place you want to put your info, even though you may not have realized it yet ;) You can serialize any data that can take advantage of NSCoding? ie NSData, and save that as a key value pair. Also, you should first l

Changing classes

2010-09-30 Thread Remco Poelstra
Hi, I've a class that represents a general piece of hardware. Subclasses of that class represent more specific versions of that hardware. When I scan the network for hardware, I first only know some basic properties of the hardware and only after some more queries I'll know all details. I thoug

Re: Should I use NSDocument, NSUserDefaults or something else

2010-09-30 Thread Mark Munz
I think you can use NSUserDefaults just fine. For the exposure example, you might do something like register a default value for "exposure" category. First check for the camera specific key ("QI1438.exposure"), if result is nil, grab the general category value. You could wrap that in a single me

Re: Changing classes

2010-09-30 Thread Allen Ingling
On Thu, Sep 30, 2010 at 2:28 PM, Remco Poelstra wrote: > Hi, > > I've a class that represents a general piece of hardware. Subclasses of > that class represent more specific versions of that hardware. When I scan > the network for hardware, I first only know some basic properties of the > hardwar

Re: Changing classes

2010-09-30 Thread Keary Suska
On Sep 30, 2010, at 1:28 PM, Remco Poelstra wrote: > Hi, > > I've a class that represents a general piece of hardware. Subclasses of that > class represent more specific versions of that hardware. When I scan the > network for hardware, I first only know some basic properties of the hardware >

Re: Changing classes

2010-09-30 Thread Quincey Morris
On Sep 30, 2010, at 12:28, Remco Poelstra wrote: > I've a class that represents a general piece of hardware. Subclasses of that > class represent more specific versions of that hardware. When I scan the > network for hardware, I first only know some basic properties of the hardware > and only a

Crash in NSBinder

2010-09-30 Thread Cate Tony
I just received two crash reports from a beta tester. Here's the common back-trace: Thread 0 Crashed: 0 libobjc.A.dylib 0x937de688 objc_msgSend + 24 1 com.apple.AppKit0x9625a7b9 -[_NSBindingInfo dealloc] + 128 2 com.apple.CoreFoundation0x

Re: Should I use NSDocument, NSUserDefaults or something else

2010-09-30 Thread Quincey Morris
On Sep 30, 2010, at 04:42, Jonny Taylor wrote: > This made me think that an NSDocument might be a more appropriate solution > (different document for each experiment, storing a hierarchical dictionary of > key/value pairs but implementing my own handling of defaults for missing > keys, etc). Ho

Re: Exceptions to the "don't use -[NSManagedObject dealloc]" rule?

2010-09-30 Thread Jonathan del Strother
Do retained NSManagedObjects never fault, then? On 30 September 2010 16:18, Dave DeLong wrote: > I'd probably set the managed object as the delegate of your URL connection.   > NSURLConnection retains its delegate, and NSURLConnection is itself retained > by the run loop, so you don't have to wo

Re: Changing classes

2010-09-30 Thread jonat...@mugginsoft.com
On 30 Sep 2010, at 20:35, Allen Ingling wrote: > On Thu, Sep 30, 2010 at 2:28 PM, Remco Poelstra wrote: > >> Hi, >> >> > Maybe a class cluster would be useful here? > Clustering might be a solution but it's a bit of a heavyweight pattern. Trying to dynamically match a stepwise revealed info

Re: Changing classes

2010-09-30 Thread Kyle Sluder
On Thu, Sep 30, 2010 at 2:45 PM, jonat...@mugginsoft.com wrote: > Trying to dynamically match a stepwise revealed information structure to a > particular class in a hierarchy sounds fragile. > If an individual hardware item property doesn't match the class hierarchies > expectations then you hav

Re: portable app

2010-09-30 Thread Ariel Feinerman
Are you sure in the using of 'library/application support'? There is of the matter is that one is designed for the app data not for the user data. Maybe you should save such files in a directory relative to the bundle or in the bundle itself (not good idea). In this case you can launch your app fro

NSCollectionView file promise drag & drop and selection

2010-09-30 Thread Nick Zitzmann
I searched for answers for these two questions and did not find anything pertinent: 1. I noticed that, on Snow Leopard, when the user clicks on a collection view item, the item is selected, but it doesn't do this on Leopard. Instead, on Leopard, the only way to select an item is to click and dr

"spawn_via_launchd() failed, errno=5" in Mac OS X 10.6.x

2010-09-30 Thread Heizer, Charles
Hello, I'm trying to launch my Reboot application for the current user but I keep seeing this message in the system.log. This used to work just fine under Mac OS X 10.5.x. Error Message: 9/30/10 5:50:01 PM /Library/mp/Client/oraw[6379] spawn_via_launchd() failed, errno=5 label=[0x0-0x18c

Is there any other way of enumerating windows and getting their positions except Accessibility API?

2010-09-30 Thread eveningnick eveningnick
Hello Is there a way in MacOS X to determine the position of the control on a screen, if the application doesnt provide Accessibility object for that control? What am I trying to do - is to get the position of the topleft corner of Mac:Word Page (it seems to be a View or something like that). Word

Re: portable app

2010-09-30 Thread Laurent Daudelin
[NSBundle mainBundle] will return the path of the application bundle, not ~/Library/Application Support/[App Name]. You need to use "NSSearchPathForDirectoriesInDomains" with the appropriate masks to search in the user's Library. -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin

Hitting Layers

2010-09-30 Thread Curious Yogurt
I'm working on a game using core animation that depends on hitting CA layers. This works great as long as the user is not in fullscreen mode; when in fullscreen, hits are still registered, but they do not correspond to the objects. Any ideas what might be going wrong? Here is my code for detecti

Continuously running daemon process CFConstantStringRefs build up over time

2010-09-30 Thread Kevin Ross
Greetings Cocoa Developers, I have run into a snag while writing my background daemon and I was hoping that there might be some people on this list that could point me in the right direction or suggest a workaround. I am writing a background daemon to handle to field incoming software update r

Flipped NSView + scaled NSAffineTransform = confusion

2010-09-30 Thread Ken Tozier
Hi I have a custom view, which contains a number of subviews, where it is much more intuitive to the user if items appear from the upper left corner than the bottom left corner. Normally, I would just flip the view and the placement of subviews is what I expect. When I apply a scaled affine tra

Re: Acquiring an NSConnection otherwise than by registered name?

2010-09-30 Thread Oleg Krupnov
Hi Ken, I've tried sockets instead of mach ports, but the result is almost the same. At first, the request via the new connection was handled in the new server thread, which rejoiced me, but then the second request to the same connection from the same client thread was handled in the main server t