iChat Theatre
iChat Theatre
- Subject: iChat Theatre
- From: Mark Alldritt <email@hidden>
- Date: Wed, 27 Feb 2008 10:47:44 -0800
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 (email@hidden)
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:
This email sent to email@hidden