Hi Folks,

I've been trying to get a simple demo app running that uses iChat Theatre (InstantMessage.framework) as described in this web page without any success:

  http://developer.apple.com/leopard/overview/imframework.html

Here's the code:

//
//  MyController.m
//  iChatDemo
//
//  Created by Mark Alldritt on 27/02/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "MyController.h"
#import <InstantMessage/IMAVManager.h>
#import <InstantMessage/IMService.h>

@implementation MyController

- (void) _handleStateChanged:(NSNotification*) notification
{
        NSLog(@"_handleStateChanged: %@", notification);

        IMAVManager *manager = [IMAVManager sharedAVManager];

        switch ([manager state])
        {
        case IMAVRequested:
                [manager start];
                break;
        }
}

- (void) _handleURLToShareChanged:(NSNotification*) notification
{
NSLog(@"_handleURLToShareChanged: %@ (%@)", notification, [[IMAVManager sharedAVManager] URLToShare]);
}

- (void) awakeFromNib
{
        IMAVManager *manager = [IMAVManager sharedAVManager];
        [manager setVideoDataSource:miChatView];

        //      Register for iChat Theater notifications
        [[IMService notificationCenter] addObserver:self
                                        selector:@selector(_handleStateChanged:)
                                        name:IMAVManagerStateChangedNotification
                                        object:nil];
        [[IMService notificationCenter] addObserver:self
                                        
selector:@selector(_handleURLToShareChanged:)
                                        
name:IMAVManagerURLToShareChangedNotification
                                        object:nil];
}

@end


miChatView is an NSImageView displaying a picture that I want to show through iChat Theatre. I never receive IMAVManagerStateChangedNotification notifications when I try and share my application file through the iChat app. My demo project is based on the Cocoa Application template, so there is no notion of a document.

Can anyone tell me what I might be doing wrong?

Thanks
-Mark

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to