저는 현재 iOS 오디오 프로젝트를 만들고 있는데 XCode의 Extras/CoreAudio/PublicUtility 폴더에서 사용할 수있는 CARingBuffer 클래스를 사용해야합니다. 문제는 내 viewController 헤더에 CARingBuffer.h를 포함시키고 CARingBuffer 개체를 선언 할 때 4 개의 컴파일 오류가 발생합니다.iOS (iPhone, iPad) 프로젝트에서 CARingBuffer 클래스를 사용하는 방법은 무엇입니까?
내 문제를 재현하려면 매우 간단합니다. 새로운 뷰 기반 애플리케이션을 만들고 viewController 헤더에 "CARingBuffer.h"를 # 포함 시키십시오. 여기
#import <UIKit/UIKit.h>
#include "CARingBuffer.h"
@interface testViewController : UIViewController {
}
@end
가 내 testViewController.m의 내용은 다음과 같습니다 : (이상하게)에있는 4 컴파일 오류 벨로
#import "testViewController.h"
@implementation testViewController
- (void)dealloc
{
[super dealloc];
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
*/
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end
CARingBuffer에 따라 다음
내 testViewController.h의 내용입니다 XCode 4 :1) 이니셜 라이저 요소가 온라인상의 상수가 아닙니다.
const UInt32 kGeneralRingTimeBoundsQueueMask = kGeneralRingTimeBoundsQueueSize - 1;
2) 예상되는 ';' 최상위 선언자 후 '='예상 ... 또는 'atribute'CARingBuffer '전 :
class CARingBuffer {
3) 초기화 소자 라인에 일정하지 않다 :
const UInt32 kGeneralRingTimeBoundsQueueMask = kGeneralRingTimeBoundsQueueSize - 1;
4) 예상 ';' 당신의 도움에 미리
class CARingBuffer {
감사 : 최고 수준의 '='예상 선언자, ... 또는 'CARingBuffer'이전 'atribute'후.