Ios7 iOS 7警报视图自动触发器

Ios7 iOS 7警报视图自动触发器,ios7,uialertview,gimbal,Ios7,Uialertview,Gimbal,我对iOS编程还很陌生,仍然学到了很多东西。我希望在某个屏幕上自动弹出警报视图。基本上,我使用新的qualquamm万向节信标作为应用程序。此代码在首次找到信标时触发日志: // FYXVisitDelegate protocol - (void)didArrive:(FYXVisit *)visit; { // this will be invoked when an authorized transmitter is sighted for the first time NS

我对iOS编程还很陌生,仍然学到了很多东西。我希望在某个屏幕上自动弹出警报视图。基本上,我使用新的qualquamm万向节信标作为应用程序。此代码在首次找到信标时触发日志:

// FYXVisitDelegate protocol
- (void)didArrive:(FYXVisit *)visit;
{
    // this will be invoked when an authorized transmitter is sighted for the first time
    NSLog(@"I arrived at a Gimbal Beacon!!! %@", visit.transmitter.name);


}
我想做的是,当第一次发现日志上写的只是为了测试的内容时,触发一个弹出窗口或警报。我想给警报打上烙印,但听说这在iOS 7中已经不可能了,所以如果有任何关于弹出窗口的建议,我也很乐意听到

这就是我没有运气的情况(尽管日志仍然被触发):


问题可能是您的消息字符串分配,您正在使用格式字符串@“%@”,但缺少对stringWithFormat的调用:

旧代码:(签出消息参数)

新代码:(注意[NSString stringWithFormat]调用)

旧代码还指定了一个以变送器名称命名的alertView按钮。我在新代码中保留了这一点,但如果不需要,请从otherButtonTitles:参数中删除“visit.transmiter.name”

此外,如果您在访问过程中查找更新,请使用此FYXVISTITManager委派方法:

  • (无效)收到的指示:(FYXVisit*)访问更新时间:(NSDate*)更新时间RSSI:(NSNumber*)RSSI
NSLog是否显示消息?是。该消息将显示在日志中。我尝试添加[alert release],但得到一个错误提示,这是一个不同的日志,显示的不是这里的日志。这似乎是问题所在。您不能添加[alert release],因为ARC会为您添加[alert release]。所以,NSLog不会显示,对吗?
- (void)didArrive:(FYXVisit *)visit;
{
    // this will be invoked when an authorized transmitter is sighted for the first time
    NSLog(@"I arrived at a Gimbal Beacon!!! %@", visit.transmitter.name);

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"%@" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:@"View", visit.transmitter.name, nil];

    [alert show];
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:@"%@" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:@"View", visit.transmitter.name, nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:[NSString stringWithFormat:@"%@",  visit.transmitter.name] delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:@"View",  visit.transmitter.name, nil];