tutorial wikiitude para iOS e objetivo c
-
21-12-2019 - |
Pergunta
Estou implementando o SDK do wikiitude para meu projeto iOS.Agora no tutorial está mostrando passo a passo e estou acompanhando.existe uma opção para adicionar ARchitectWorld.Não estou conseguindo o que adicionar nessa opção de pasta.Devo pegar o arquivo .js .css e .html do exemplo que eles mostraram.estou ficando um pouco confuso.Agora também adicionei o código.Mas não obtendo nada frutífero.Minha pergunta é qual código devo adicionar para que o ARworld funcione.Estou testando meu iPOD de 5ª geração.Está me mostrando uma mensagem e a tela está em branco.
A mensagem é 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.
Meu código é
- (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];
}
}
Qualquer ajuda é necessária.obrigado.
Solução
Eu tive o mesmo problema.Quando executei o projeto no iPhone, funcionou bem.Não tente com iPods.
E você também precisa verificar se todas as etapas em esse link foi feito corretamente.
Especialmente configurando as configurações de compilação em ambos Guia Projetos e Metas,
O SDK do Wikitude requer que o sinalizador do vinculador -ObjC esteja definido.Os sinalizadores de ligação podem ser ajustados na guia Configurações de criação de projetos.Pesquise outros sinalizadores de ligação e adicione uma nova entrada se ainda não existir.