Tuesday, August 14, 2007

Killing a process by name in Objective-C

Okay, so one thing that really frustrated me was that in objective-c, there wasn't a way to kill a process by name. Well, I found the way to do it. There is a command line application that you can use to kill a process by its name. To use this in Objective-C, you just need to use the following.

system("usr/bin/killall processName");

If you want to make this dynamic created using a NSString, just make sure you call the cString function on the NSString object.

No comments: