第二次发布后制作UIAlertView节目

如果那是不可能的,那么在使用3分钟之后我该怎么办呢? 这将用于Rate Us警报但我宁愿用户有一些时间来实际使用该应用程序,然后才要求他们评分。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)options { // ... if ([self plusPlusLaunchCount] == 2) { [self showRateUsAlert]; } return YES; } - (void)showRateUsAlert { // show the Rate Us alert view } - (NSInteger)plusPlusLaunchCount { static NSString *Key = @"launchCount"; NSInteger count = 1 + [[NSUserDefaults standardUserDefaults] integerForKey:Key]; [[NSUserDefaults standardUserDefaults] setInteger:count forKey:Key]; return count; } 

为什么不使用第三方库,而不是自己给“评价我们”提醒? 无论如何,这种事情已经做了很多次。

这是一个非常好的一个: iRate

不完全回答标题中的问题。

您需要在要显示警报的时间间隔内设置NSTimer 。 当应用程序启动时启动计时器,并在设置完成后的间隔后显示警报。

我建议您使用每次启动应用程序时调用的DidBecomeActive,它来自后台/睡眠模式:

如果用户长时间不使用应用程序,您需要取消计时器。

 - (void)applicationDidBecomeActive:(UIApplication *)application{ // Override point for customization after application launch. rateUsTimer = [[NSTimer scheduledTimerWithTimeInterval:180 target:self selector:@selector(showRateUsAlert) userInfo:nil repeats:NO] retain]; } - (void)applicationWillResignActive:(UIApplication *)application{ [rateUsTimer_ invalidate]; [rateUsTimer_ release]; rateUsTimer = nil; } - (void)applicationDidEnterBackground:(UIApplication *)application{ [rateUsTimer_ invalidate]; [rateUsTimer_ release]; rateUsTimer = nil; } - (void)showRateUsAlert { //Here you present alert [rateUsTimer_ release]; rateUsTimer = nil; }