QTMovie委托方法未被调用

时间:2011-03-12 21:36:21

标签: objective-c macos quicktime

嘿,我正在尝试捕获QTMovie进度委托方法调用,并且委托方法似乎没有被调用。我正试图通过实现

来捕获转换进度事件

- (BOOL)电影:(QTMovie *)电影应该继续操作:(NSString *)op withPhase:(QTMovieOperationPhase)阶段atPercent:(NSNumber *)百分比withAttributes:(NSDictionary *)属性

但该方法未被调用。我在这里查看了苹果示例代码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

1 个答案:

答案 0 :(得分:0)

似乎这不起作用,因为我的应用程序是为64位编译的。我假设这是QTKit框架中的一个错误?我发现了其他一些QTMovie代表在64位应用程序中工作的提及。我可以编译我的应用程序32位虽然这不是一个问题。不过,这应该在64位工作,不应该吗?

相关问题