Problems with repetetive execution of netstat using NSTask and NSTimer
Problems with repetetive execution of netstat using NSTask and NSTimer
- Subject: Problems with repetetive execution of netstat using NSTask and NSTimer
- From: Kazior Fukacz <email@hidden>
- Date: Mon, 5 Apr 2010 23:05:18 +0200
Hello,
I'm working on an application named IPShowX. Take a look at for more
info: http://kaziorvb.pl/IPShowX/
When I run it, it keeps working perfectly fine for a few minutes,
then stops refreshing the IP and prints:
IPShowX[14917] *** NSTimer discarding exception '*** -[NSCFDictionary
setObject:forKey:]: attempt to insert nil value' that raised during
firing of timer with target 34e410 and selector 'getGameIP:'
every 3 seconds (what's my NSTimer's interval). It's my first Cocoa
application and I don't really understand the problem.
My application works like this:
- On awakeFromNib it sets up the timer and executes my IP-refreshing
method named getGameIP for the first time
- Every 3 seconds, the timer executes the mentioned getGameIP method,
parses netstat's output and changes my NSTextField's value to the
parsed IP
This is how my class' .m file looks like:
http://ipshowx.pastebin.com/ARFR3HRr
As you can see, getGameIP reads output of "netstat -n". Then looks
for ".4000" in it. If it finds that substring, it extracts 4
preceding characters, then extracts characters that occur right after
the "." and finally passes them to the text field. Otherwise the
method sets the text field's value to "-".
I tried googling the error but I couldn't find anything either
related or helpful.
I would greatly appreciate if anyone could take a look at my issue.
Regards,
kaziorvb
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden