Skip navigation.
 
mliChat Theatre
FROM : Mark Alldritt
DATE : Wed Feb 27 19:47:44 2008

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

Related mailsAuthorDate
mliChat Theatre Mark Alldritt Feb 27, 19:47
mlRe: iChat Theatre j o a r Feb 27, 22:48
mlRe: iChat Theatre Chilton Webb Feb 27, 22:49
mlRe: iChat Theatre Mark Alldritt Feb 29, 00:00