[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LPT_Interface.app - implementing button action
From: |
Germán Arias |
Subject: |
Re: LPT_Interface.app - implementing button action |
Date: |
Fri, 17 Sep 2010 23:11:00 -0600 |
On vie, 2010-09-17 at 18:50 +0200, Csanyi Pal wrote:
> I created English.lproj too for LPT_Interface.app and ask you to try it
> out after downloading and compiling it again from here:
> ftp://csanyi-pal.info/objective-c/LPT_Interface.tar.bz2
>
Well, now the app can run on my system.
>
> [code]
> NSString *title = [sender title];
>
> if ([title isEqualToString: @"1"])
> {
> [StatLine setStringValue: @"write logical 1 to the data port"];
> }
> else if ([title isEqualToString: @"0"])
> {
> [StatLine setStringValue: @"write logical 0 to the data port"];
> }
> [/code]
>
> I did try the code:
>
> else if (![title isEqualToString: @"1"])
>
> but this doesn't works.
>
> Any advices?
>
I think you can solve this using tags. Something like:
<botton title="something" tag=1 />
And then you can use these on your code. For example:
if ([sender tag] == 1)
{
[sender setTag: anotherNumber....
.....
.....
As the tags don't have relationship with the button's titles. You can
use the necesary tags to the control.