I'm trying to modify apple's examples: Picture Sharing and Picture Sharing 
Browser

I creating iphone's app, which is my server side (Picture Sharing), also i 
creating standalone's app, which is client side (Picture Sharing Browser), 
which i launched on my mac.

It works great, but when i sent data from my iphone to my mac's app i should 
press button for changing my data. For example, i sent the next data from 
iphone:

- (void)connectionReceived:(NSNotification *)aNotification {
    NSFileHandle* incomingConnection = [[aNotification userInfo] 
objectForKey:NSFileHandleNotificationFileHandleItem];
NSString *s = @"something...";
const char *utfMyString = [s UTF8String];
NSData *representationToSend = [NSData dataWithBytes:utfMyString 
length:strlen(utfMyString)];
    [[aNotification object] acceptConnectionInBackgroundAndNotify];
    [incomingConnection writeData:representationToSend];
    [incomingConnection closeFile];
    numberOfDownloads++;
}

My app has the next code:
- (IBAction)serviceClicked:(id)sender
{
    int index = 0;
    if(serviceBeingResolved) {
        [serviceBeingResolved stop];
        [serviceBeingResolved release];
        serviceBeingResolved = nil;
    }
    if(-1 == index) {
NSLog(@"");
    } else {        
        serviceBeingResolved= [servicesobjectAtIndex:index];
        [serviceBeingResolvedretain];
        [serviceBeingResolvedsetDelegate:self];
        [serviceBeingResolvedresolve];
    }
}

...

- (void)readAllTheData:(NSNotification *)note
{
NSData*data = [[note userInfo] 
objectForKey:@"NSFileHandleNotificationDataItem"];
NSString*string = [NSStringstringWithCString:[data bytes] length:[data length]];
[txt setString:string];
    [[NSNotificationCenterdefaultCenter] 
removeObserver:selfname:NSFileHandleReadToEndOfFileCompletionNotificationobject:[note
 object]];
    [[note object] release];
}

How can i use some event, which will be call serviceClicked when my app did 
receive any message from iphone     



      
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to