小编bur*_*lac的帖子

我可以在目标C中使用枚举作为属性

我看到使用布尔属性作为标志是自定义的.类似的东西:

@property (nonatomic) BOOL commaAlreadyIntroduced;
Run Code Online (Sandbox Code Playgroud)

我需要这样的东西,但至少有3或4个状态.

我可以使用枚举吗?

独立枚举应如下所示:

typedef enum stackState{
    empty, oneOperand, operandAndOperator, fullStack
}stackState;
Run Code Online (Sandbox Code Playgroud)

xcode enums properties objective-c ios

29
推荐指数
2
解决办法
2万
查看次数

AVAssetExportSession - mov audio only file无法导出?


我有一个音频播放器应该能够播放多种音频格式.该应用程序正在使用BASS音频库,它需要一些导出.以下是格式.除了.mov(仅音频)格式的文件外,一切正常.

关于正确解决方法的任何想法?


exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetPassthrough];
if (nil == exportSession)
    @throw [NSException exceptionWithName:TSUnknownError reason:@"Couldn't create AVAssetExportSession" userInfo:nil];

if ([[assetURL pathExtension] compare:@"mp3"] == NSOrderedSame) {
    [self doMp3ImportToFile:destURL completionBlock:completionBlock];
    return;
}

exportSession.outputURL = destURL;

// set the output file type appropriately based on asset URL extension
if ([[assetURL pathExtension] compare:@"m4a"] == NSOrderedSame) {
    exportSession.outputFileType = AVFileTypeAppleM4A;
} else if ([[assetURL pathExtension] compare:@"wav"] == NSOrderedSame) {
    exportSession.outputFileType = AVFileTypeWAVE;
} else if ([[assetURL pathExtension] compare:@"aif"] == NSOrderedSame) {
    exportSession.outputFileType = AVFileTypeAIFF; …
Run Code Online (Sandbox Code Playgroud)

objective-c ios xcode4 avassetexportsession

2
推荐指数
1
解决办法
2403
查看次数