1

我正在为我的 iOS 项目实现 wikiitude SDK。现在在教程中它一步一步地展示,我正在关注它。有一个添加 ARchitectWorld 的选项。我没有在该文件夹选项中添加什么。我是否必须从他们展示的示例中获取 .js .css 和 .html 文件。我有点困惑。现在我也添加了代码。但没有收获任何成果。我的问题是我应该添加什么代码才能让 ARworld 工作。我正在测试我的第 5 代 iPOD。它向我显示一条消息,屏幕为空白。

消息是This device is not capable of running ARchitect Worlds. Requirements are: iOS 6 or higher, iPhone 3GS or higher, iPad 2 or higher. Note: iPod Touch 4th and 5th generation are only supported in WTAugmentedRealityMode_IR.

我的代码是

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    NSLog(@"here it comes");
    if ( [WTArchitectView isDeviceSupportedForAugmentedRealityMode:WTAugmentedRealityMode_Both] ) { // 1

        NSLog(@"not entering");
        self.architectView = [[WTArchitectView alloc] initWithFrame:self.view.bounds motionManager:nil augmentedRealityMode:WTAugmentedRealityMode_Both];

       // [self.architectView setLicenseKey:@"MY-LICENSE-KEY"]; // 2
        [self.architectView setLicenseKey:nil];

        NSURL *architectWorldUrl = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"];
        [self.architectView loadArchitectWorldFromUrl:architectWorldUrl];

        [self.view addSubview:self.architectView]; // 3
    }

    else {



        NSLog(@"This device is not capable of running ARchitect Worlds. Requirements are: iOS 6 or higher, iPhone 3GS or higher, iPad 2 or higher. Note: iPod Touch 4th and 5th generation are only supported in WTAugmentedRealityMode_IR.");
    }

}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];


    [self.architectView start];
    if ( [self.architectView isRunning] ) {

       NSLog(@"ARchitect is running with version: %@", [WTArchitectView versionNumber]);
    }else {
       NSLog(@"WTARchitectView wasn't able to start. Please check e.g. the -ObjC linker flag in your project settings.");
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)startAR
{
    if([self.architectView isRunning])
    {

        NSLog(@"architect view is working");
        [self.architectView start];
    }
    else{
         NSLog(@"architect view is NOT working");
    }
}
-(void)stopAR
{
    if([self.architectView isRunning])
    {
        [self.architectView stop];
    }


}

需要任何帮助。谢谢。

4

1 回答 1

0

我遇到过同样的问题。当我在 iPhone 中运行该项目时,它运行良好。不要尝试使用 iPod。

您还需要检查此链接中的所有步骤是否正确完成。

特别是在项目和目标选项卡中配置构建设置,

Wikiitude SDK 要求设置 -ObjC 链接器标志。可以在项目构建设置选项卡中调整链接器标志。搜索 Other Linker Flags 并添加一个新条目(如果它尚不存在)。

在此处输入图像描述

于 2014-08-16T06:24:20.470 回答