1
저는 cocos2d를 사용하고 있으며, CCMenuItemFont의 IF 텍스트를 두드려면 UIAlertView가 팝업되도록하고 싶습니다. alertView를 팝업으로 표시 할 수 있지만 텍스트를 두드린 후 다시 표시하려고합니다. 여기에 내 코드 INIT입니다CCMenuItemFont (텍스트)가 탭 된 경우 UIAlertView
rate = [CCMenuItemFont itemFromString:@"Rate App" target:self selector:@selector(rateIsTapped:clickedButtonAtIndex:)];
rate.position = ccp(240, 160);
[self addChild:rate];
-(void)rateTapped:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
rateView = [[UIAlertView alloc] initWithTitle:@"Like This App?" message:@"Rate it on the App Store!" delegate:self cancelButtonTitle:@"No thanks" otherButtonTitles:@"Sure, I'll rate it!", nil];
[rateView show];
[rateView autorelease];
[defaults setBool:YES forKey:@"rate"];
if (buttonIndex == 0) {
//[alertView collapse];
}
if (buttonIndex == 1) {
NSURL *url = [NSURL URLWithString:@"LINK TO RATE IN APP STORE"];
[[UIApplication sharedApplication] openURL:url];
}
}
시뮬레이터에서 평가판 앱을 클릭해도 아무런 변화가 없습니다. 하지만 아무런 충돌이 없습니다 – Joethemonkey101
그리고 네, 그것을 2 방법으로 변경하고 선택기는 첫 번째 방법 (속도) – Joethemonkey101
NSLog 속도 애플 리케이션 기능 .. 그것은 기능을 실행 했습니까 ?? – xuanweng