NSDistributedNotificationCenter Strangeness

2013-12-17 Thread Pax
according to my search of this list, to see if anyone else was having the same problem) the Radar was opened in 2011 - which should be enough time to squish the bug! I'm trying to use NSDistributedNotificationCenter to communicate between two apps. The app posting the notificatio

NSDistributedNotificationCenter Strangeness

2013-12-16 Thread Pax
squish the bug! I'm trying to use NSDistributedNotificationCenter to communicate between two apps. The app posting the notification does it as follows: NSDistributedNotificationCenter *centre = [NSDistributedNotificationCenter defaultCenter]; NSDictionary *dict = [NSDictionary dicti

NSDistributedNotificationCenter Strangeness

2013-12-16 Thread Pax
squish the bug! I'm trying to use NSDistributedNotificationCenter to communicate between two apps. The app posting the notification does it as follows: NSDistributedNotificationCenter *centre = [NSDistributedNotificationCenter defaultCenter]; NSDictionary *dict = [NSDictionary dicti

Re: NSDistributedNotificationCenter and Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
nn > wrote: > >> I have a Helper Tool, running as root, started via SMJobBless and >> communicating vie Xpc. >> >> Sometimes it does: >> >> [[NSOperationQueue mainQueue] addOperationWithBlock:^ >> { >> NSDistributedNotificat

Re: NSDistributedNotificationCenter and Helper Tool

2013-09-15 Thread Jeff Johnson
ionQueue mainQueue] addOperationWithBlock:^ > { > NSDistributedNotificationCenter *d = [ > NSDistributedNotificationCenter defaultCenter ]; > NSLog(@"%s will postNotificationName on %@",__FUNCTION__,d); > // prints:

NSDistributedNotificationCenter and Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
I have a Helper Tool, running as root, started via SMJobBless and communicating vie Xpc. Sometimes it does: [[NSOperationQueue mainQueue] addOperationWithBlock:^ { NSDistributedNotificationCenter *d = [ NSDistributedNotificationCenter defaultCenter

Re: NSDistributedNotificationCenter questions.

2011-02-19 Thread Mr. Gecko
Something like this? static NSAutoreleasePool *pool = nil; void runloop(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { if (activity & kCFRunLoopEntry) { if (pool!=nil) [pool drain]; pool = [NSAutoreleasePool new]; } else i

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Mr. Gecko
Here is some proof that it is still in memory, I waited about 5 minutes and it didn't dealloc automatically like you said it will... <> When I wrap a NSAutoreleasePool around the notification method, it releases as expected. I cannot have my application doing this as it is a background applicati

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Kyle Sluder
On Fri, Feb 18, 2011 at 7:36 PM, Mr. Gecko wrote: > Yes, that would be it, when I open the UI it releases the pool. Is there a > way to prevent this from happening just incase I have other things that are > autoreleasing to it? Nest your own autorelease pool. You can use a runloop observer to m

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Mr. Gecko
Yes, that would be it, when I open the UI it releases the pool. Is there a way to prevent this from happening just incase I have other things that are autoreleasing to it? On Feb 18, 2011, at 8:20 PM, Ken Thomases wrote: > Is your application getting any real GUI-style events, or is it only >

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Mr. Gecko
That may be the problem as this is a UIAgent and not a real GUI. The only GUI that appears is when you first open it or you open it again to change settings. I have many other types of notifications I'm listening for such as carbon events and accessibility events, but I don't know if they are ad

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Ken Thomases
On Feb 18, 2011, at 3:00 PM, Mr. Gecko wrote: > I noticed that memory is not autoreleased when I receive a distributed > notification, the only way to fix this is to wrap it in a autorelease pool, > but this shouldn't be right? I would think that when you register for a > notification it'll be

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Mr. Gecko
More information found. This may be a bug. I found this really cool method for NSAutoreleasePools called showPools. It is really useful for something like this. I found that it has a autorelease pool, but it never drains. It just gains items until it gets to 1016 items and then I don't know what

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Mr. Gecko
I know that you think I'm some noob at this. This may be true, but I am aware that Instruments shows that the memory I allocated during that distributed notification is still there. I know this because it's a 9MB allocation and it's in a NSData with no copy bytes and free when released. The one

Re: NSDistributedNotificationCenter questions.

2011-02-18 Thread Fritz Anderson
On 18 Feb 2011, at 3:00 PM, Mr. Gecko wrote: > I noticed that memory is not autoreleased when I receive a distributed > notification, the only way to fix this is to wrap it in a autorelease pool, > but this shouldn't be right? I would think that when you register for a > notification it'll be o

NSDistributedNotificationCenter questions.

2011-02-18 Thread Mr. Gecko
I noticed that memory is not autoreleased when I receive a distributed notification, the only way to fix this is to wrap it in a autorelease pool, but this shouldn't be right? I would think that when you register for a notification it'll be on the run loop which has a autorelease pool and there

Re: Foundation Tool and NSDistributedNotificationCenter

2009-10-23 Thread Jerry Krinock
On 2009 Oct 23, at 08:37, Zephyroth Akash wrote: [[NSRunLoop currentRunLoop] run]; I believe you need to read All About Run Loops... http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/RunLoopManagement.html#/ /apple_ref/doc/uid/1057

Fwd: Foundation Tool and NSDistributedNotificationCenter

2009-10-23 Thread Zephyroth Akash
Début du message réexpédié : De : Zephyroth Akash Date : 23 octobre 2009 17:59:48 HAEC À : Jens Alfke Objet : Rép : Foundation Tool and NSDistributedNotificationCenter The tool launch the application. The application post a notification to the tool. The tool get the notification and do

Re: Foundation Tool and NSDistributedNotificationCenter

2009-10-23 Thread Jens Alfke
On Oct 23, 2009, at 8:37 AM, Zephyroth Akash wrote: It works fine, the tool get the notification and do its work ... but I'm unable to notify the application that the work is done. Are you posting another notification from your tool back to the application? In the code you posted I'm not c

Foundation Tool and NSDistributedNotificationCenter

2009-10-23 Thread Zephyroth Akash
k ... but I'm unable to notify the application that the work is done. Nothing happens. At the end of my "main.m": NSDistributedNotificationCenter *dnc = [NSDistributedNotificationCenter defaultCenter]; [dnc addObserver:hardDetect selector:@selector(getBootInfo:)

Re: NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Stephane Sudre
On Jan 9, 2009, at 12:58 AM, Aaron Scott wrote: I have a background process that when started manually talks correctly with the GUI app using NSDistributedNotificationCenter. However, once I use launchd to start it as a LaunchDaemon I get no receiving of notifications from either the

Re: NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Kyle Sluder
ad TN2083, "Daemons and Agents"? http://developer.apple.com/technotes/tn2005/tn2083.html Looking at the "Supporting Fast User Switching" section of the "Multiple User Environments" guide, it seems to be implied that NSDistributedNotificationCenter only works on GUI log

NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Aaron Scott
I have a background process that when started manually talks correctly with the GUI app using NSDistributedNotificationCenter. However, once I use launchd to start it as a LaunchDaemon I get no receiving of notifications from either the daemon or the GUI app. Is there a way to get the

Re: Debugging NSDistributedNotificationCenter

2008-10-30 Thread Chris Kane
p. Chris Kane Cocoa Frameworks, Apple On Oct 25, 2008, at 16:48, Jeff Johnson wrote: I'm using NSDistributedNotificationCenter to deliver notifications from a helper application to the main application. I followed the instructions from <http://developer.apple.com/technotes/tn20

Debugging NSDistributedNotificationCenter

2008-10-25 Thread Jeff Johnson
I'm using NSDistributedNotificationCenter to deliver notifications from a helper application to the main application. I followed the instructions from <http://developer.apple.com/technotes/tn2004/tn2124.html#SECFILES >, i.e., sudo touch /var/log/do_dnserver_log and restart, but thi

NSDistributedNotificationCenter in a prefpane?

2008-10-14 Thread randy chapel
Hi, has anyone been able to get a NSDistributedNotificationCenter (send/rec) to work within a prefpane? Randy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

NSDistributedNotificationCenter

2008-10-14 Thread randy chapel
Hi, Has anyone had any luck using a NSDistributedNotificationCenter in a prefpane? code: in using the pref pane example from apple (http://developer.apple.com/samplecode/PrefsPane/index.html), I used the following code in the mainViewDidLoad method. NSDistributedNotificationCenter *center