Think about what scheduledTimerWithTimeInterval: does.
Apart from that, your request is really weird and it seems you are asking for help to shoot yourself in the foot. What do you actually try to achieve?
I use this code snippet in application source code :
Code:
NSDictionary *activeApp = [[NSWorkspace sharedWorkspace] activeApplication];
appName = (NSString*)[activeApp objectForKey:@"NSApplicationName"];
i use this code for getting active(focused application's) name.application works good but when i logout and login again appName variable got null value!
* this code snippet exist in the runlooped method.
I find out when restart the daemon,it's works well! first i unload the daemon and load again with blow commands :
Code:
launchctl unload /Library/LaunchDaemons/daemon.plist
Code:
launchctl load /Library/LaunchDaemons/daemon.plist
I have another daemon(second daemon) like mentioned daemon when first daemon got null second daemon restart first daemon.but not works!
i use mentioned commands in second daemon like below :
Code:
system("launchctl unload /Library/LaunchDaemons/daemon.plist");
Code:
system("/bin/launchctl load /Library/LaunchDaemons/daemon.plist");
but these commands can't restart daemon.when i remove load command unload command works.
----------
If you really want to restart from scratch you could just re-exec yourself or maybe setjmp/longjmp?
Yes,i want to relaunch application again and exit() first process of application.