QTMovie委托方法不被称为
问题描述:
嘿,我试图陷入QTMovie进度委托方法调用,并且委托方法似乎并没有被调用。我通过实施试探转换进度事件QTMovie委托方法不被称为
- (BOOL)电影:(QTMovie *)电影shouldContinueOperation:(的NSString *)运算withPhase:(QTMovieOperationPhase)相atPercent:(NSNumber的*)%的withAttributes: (NSDictionary *)attributes
但该方法没有被调用。我在这里查看了苹果示例代码http://developer.apple.com/library/mac/#samplecode/QTKitProgressTester/Introduction/Intro.html#//apple_ref/doc/uid/DTS10003631,看起来我的代码和他们的代码看起来没有很大的区别。该文件转换得很好,并显示在我的桌面上,我可以播放它没有问题。我无法获得进展事件。有任何想法吗?这里是我用来测试这个的演示应用程序。
#import "testProjAppDelegate.h"
#import <QTKit/QTKit.h>
@implementation testProjAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
QTMovie* movie = [QTMovie movieWithFile:@"/Users/Morgan/Desktop/sample_iTunes.mov" error:nil];
if (movie)
{
[movie setDelegate:self];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], QTMovieExport,
[NSNumber numberWithInt:kQTFileType3GPP], QTMovieExportType, nil];
[movie writeToFile:@"/Users/Morgan/Desktop/test.mp4" withAttributes:dict error:nil];
NSLog(@"DONE");
}
}
- (BOOL)movie:(QTMovie *)movie shouldContinueOperation:(NSString *)op withPhase:(QTMovieOperationPhase)phase atPercent:(NSNumber *)percent withAttributes:(NSDictionary *)attributes
{
NSLog(@"PROGRESS");
return YES;
}
@end
答
看来,这是行不通的,因为我的应用程序编译为64位。我假设这是QTKit框架中的一个错误?我发现其他一些提及的QTMovie代表不适用于64位应用程序。我可以编译我的应用程序的32位,虽然这不是一个问题。尽管如此,这应该在64位工作,不是吗?
你有没有找到64位解决方案?谢谢 – 2012-05-29 17:38:31