Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa IRC Client Problems

Cocoa IRC Client Problems
Thread Tools
Junior Member
Join Date: Jul 2002
Location: Australia
Status: Offline
Reply With Quote
Aug 22, 2002, 09:58 PM
 
Ok, I have made my simple IRC Client. It has 2 NSTextFields (serverHost & serverPort) and NSTextView (clientConsole) and a pushbutton (Connect)

I have made a sub class of NSObject called "Controller" with 3 outlets (for the text field/views) and an action (connect. I have linked the Connect button to the action connect:

The connect action uses smallsockets to connect to the specified irc serer/port. I made a loop like this:

Code:
responseSize = [response length]; while ( responseSize > 0 ) { /* Read data from server */ [socket readData:response]; /* Translate data into ResponseString */ responseString = [[[NSString alloc] initWithData:response encoding:[NSString defaultCStringEncoding]] autorelease]; /* Update Console output */ [clientConsole insertText:responseString]; [clientConsole insertText:@"\n"]; }
This reads the incomming data from the server and outputs it to the clientConsole (NSTextView). Though the problem is that It cuts out after a 30-sec timeout because my client doesn't reply to the server pings. Also it only updates the clientConsole (NSTextView) after the while statement. Is there anyway to refresh the clientConsole every while loop... like something at the end of the loop like refreshControl(clientConsole);

Any help what so every would be appreciated..

P.S. I once heard something about notifications in cocoa or something that might ba able to help me...

anway Thanks in advance!!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2