PDA

View Full Version : Trying to create a QTMovie object.




larswik
Jun 4, 2013, 04:38 PM
I am having an issue with creating a QTMovie file when it is a reference file? The program is designed to iterate through folders and find .mov files. Sometime I create files from a program like Final Cut Pro that are reference files. I am guessing that they are QTDataRefference files.


for (NSString *aKey in filesPathArray) {
currentItemLabel.stringValue = aKey;
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
NSDictionary *tempInfoDict;
tempInfoDict = [fm attributesOfItemAtPath:aKey error:NULL]; //Gets the attributes of a QT movie file.

NSError *error;
QTMovie *movieObject;

@autoreleasepool {
@try {

BOOL canBeUsed = [QTMovie canInitWithFile:aKey];
if (canBeUsed) {
movieObject = [QTMovie movieWithFile:aKey error:&error];
....
...
}
else{
NSLog(@"Can Not create QTMovie file: %@", aKey);
}
@catch (NSException *exception) {
NSLog(@"%@", exception.reason);
}
@finally {

}
if (error) {
NSLog(@"Error Creating movie Object: %@", error);

}

}


In the bold area it just stops and exits out. Even though I have set up an NSError it won't display that error message. When I say it stops I mean it exits out or stops in the middle of the for loop without warning at all? when I debug line by line it exits out of the debugger with no crash or warning?

Per the Docs, if it fails to create a QTMovie object it returns an error. But it dose not?

The files that it tries to create an QTMovie object are old .mov video files that no longer point to valid video data and just display a black screen with audio.

I should also mention that I am calling this method from GCD. But when it returns to the main queue it should NSLog that it finished and It logs nothing, it just exits out with no crashes or anything else.


dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self getFileData];
dispatch_async( dispatch_get_main_queue(), ^{
[self boxIsChecked:everythingArray];
currentItemLabel.stringValue = @"Load Complete";
NSLog(@"Finished loading.");
});
});



There is little Google information to this type of problem I am having.