 |
 |
I have an easy question (I hope).
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
Code:
@implementation TestApp
- (IBAction)something :(id)sender
{
test = [[NSTask alloc] init];
[test setLaunchPath:@"/test"];
[test launch];
}
@end
Now, all I want to do is put what [test launch] returns into a text box. I see the result in the "Run" tab. I don't know how to make it work with a text box.
Let's assume my text box is named "textBox"
I've tried adding the code: [textBox setStringValue:[test launch]; but that doesn't work. I've also tried adding a text string, called "textstring" and I did something like this (added the code in bold to the code above):
Code:
@implementation TestApp
- (IBAction)something :(id)sender
{
test = [[NSTask alloc] init];
[test setLaunchPath:@"/test"];
[test setStandardOutput:textstring];
[test launch];
[textBox setStringValue:teststring];
}
@end
This doesn't work.
Any help?
[edit: smilies get me every time]
------------------
[This message has been edited by Xeo (edited 05-10-2001).]
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
If you'll notice, I have another thread asking about how to use NSPipe...
How about you show me how to use it. I am having a hell of a time trying to get it working by reading about it.
------------------
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Germany
Status:
Offline
|
|
|
|
|
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
|
| |
|
|
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
Thank you Stefan!! Exactly what I needed to get going.
Thank you soo much!
------------------
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2000
Status:
Offline
|
|
Sorry, I wasn't trying to be rude...
Real life can really get in the way sometimes. I had about 3 seconds to post when I thought I'd have 10 minutes. And since then I haven't really been able to get back on here. I had planned on a more detailed post 'cause I fumbled through using NSTask/NSPipe too. So, anyway, the best I could come up with was what I posted.
Maybe I should've said, "man popen" and "man system"?  Those can be really useful when you don't need everything NSTask offers. Also, when in doubt, search Omni's MacOSX-dev list.
Glad you got what you needed, anyway! 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|