Re: NSKeyedArchiver UTF-8 problems
Re: NSKeyedArchiver UTF-8 problems
- Subject: Re: NSKeyedArchiver UTF-8 problems
- From: Raphael Bartolome <email@hidden>
- Date: Thu, 6 Oct 2005 12:08:58 +0200
think I have wait until the end! I hope it
I have create a Notification that runs the selector
- (void)openIncomingCommunication:(NSNotification *)aNotification
{
NSLog(@"open incoming request");
NSFileHandle *incomingConnection = [[aNotification userInfo]
objectForKey:NSFileHandleNotificationFileHandleItem];
SendAndReceiveObjects *sarObj;
sarObj = [[SendAndReceiveObjects alloc]
initWithConnection:incomingConnection];
[sarObj setController:self];
}
when data arrived. in The sendandreceivedObjects
I create a new notification, that (I hope) wait for the end
- (id)initWithConnection:(NSFileHandle *)aFileHandle
{
fileHandle = [aFileHandle retain];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self
selector:@selector(receiveIncoming:)
name:NSFileHandleReadCompletionNotification
object:fileHandle];
[fileHandle readInBackgroundAndNotify];
return self;
}
when it ends, I call
- (void)receiveIncoming:(NSNotification *)notification
{
NSData *messageData = [[notification userInfo]
objectForKey:NSFileHandleNotificationDataItem];
NSLog(@"OutPutLenght %d",[messageData length]);
if ( [messageData length] == 0 ) {
[fileHandle readInBackgroundAndNotify];
return;
}
//NSLog(@"%@",messageData);
Data_Object *recObj = [[Data_Object alloc]init];
[recObj readReceivedData:messageData];
[(Archive_Support *)[[controller main_controller]
archive_support] sendNewObject:recObj];
[fileHandle readInBackgroundAndNotify];
NSLog(@"I have received a object _______________________");
}
I think this ok, or not?
raphael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden