Csanyi Pal <[email protected]> writes:

> I'm trying to run a command from my app using NSTask.
> Here is the part od the code:
>
> [code]
> - (void) DPbitSetReset: (id)sender
> {
>   NSSound *DPbitReset = [NSSound soundNamed: @"DPbitReset.wav"];
>   NSSound *DPbitSet = [NSSound soundNamed: @"DPbitSet.wav"];
>
>   NSTask *DPSetBit0 = [[NSTask alloc] init];
>   [DPSetBit0 setLaunchPath: @"/usr/local/bin/DPSetBit0"];
>
>   // Whether the button state is 1 or 0?
>   if ([sender state] == 1)
>      {
>        // Play the bit set sound
>        [DPbitSet play];
>
>        // Which bit to set on Data Port?
>        switch ([sender tag])
>        {
>        case 110: // DPb0sr
>          [DPSetBit0 launch];
>          [DPSetBit0 release];
>          [StatLine setStringValue: @"Write logical 1 to the data port bit 
> 0."];
>          break;
>        case 111: // DPb1sr
>          [StatLine setStringValue: @"Write logical 1 to the data port bit 
> 1."];
>          break;
> [/code]
>
> I can compile my app but when I run it and use this part of my app, that
> is when click on the button which has sender tag: 110, the statement
> [DPSetBit0 launch]; has no effect. Why?
>
> If I run from the commandline the command '/usr/local/bin/DPSetBit0'
> it works. 

It works!

I forgot to install (sudo -E make install) my app after 'make'. :)

-- 
Regards, Paul Chany
<http://sourceforge.net/projects/lptinterface/>
<http://savannah.nongnu.org/projects/lpt-interface/>
<http://csanyi-pal.info>


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to