Since CMTime
is a struct, you need to wrap it in an Objective C type, usually with NSValue
:
CMTime startTime = (...);
NSValue *startValue = [NSValue valueWithBytes:&startTime objCType:@encode(CMTime)];
[clipDetails setObject:startValue forKey:@"startTime"];
You can get it out again like so:
CMTime startTime;
NSValue *startValue = [clipDetails objectForKey:@"startTime"];
[startValue getValue:&startTime];
Sidenote, it's much easier to use the new dictionary syntax:
clipDetails[@"startTime"] = ...;
NSValue *value = clipDetails[@"startTime"];
Those steps will work for any struct; as it turns out, the AVFoundation framework provides convenience methods for CMTime structs:
clipDetails[@"startTime"] = [NSValue valueWithCMTime:startTime];
CMTime startTime = [clipDetails[@"startTime"] CMTimeValue];