• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSKeyedArchiver UTF-8 problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: NSKeyedArchiver UTF-8 problems
  • Next by Date: Re: CoreData - NSManagedObjectContext notifications - Save vs DidChange ?
  • Previous by thread: Re: NSKeyedArchiver UTF-8 problems
  • Next by thread: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)
  • Index(es):
    • Date
    • Thread