自从将我的设备(iPhone 11)升级到 iOS 14.0.1 后,我发现 addUIInterruptionMonitor() 根本不会被触发。它之前在 iOS 13.4.1 上运行,这是我安装的最后一个版本。
我的代码:
addUIInterruptionMonitor(withDescription: "App Would Like to Send You Notifications") { (alert) -> Bool in
if alert.buttons["Allow"].exists {
alert.buttons["Allow"].tap()
return true
}
return false
}
XCUIApplication().tap() // interacting with the app to trigger the interruption monitor
Run Code Online (Sandbox Code Playgroud)
升级后我的代码没有任何变化 - 唯一发生变化的是安装了 iOS 版本。有没有其他人遇到过类似的?
这是我的代码:
#include <iostream>
using namespace std;
int main()
{
int n,k,i,x;
cout << "Enter a row number for Pascal's Triangle: ";
cin >> n;
for(i=0;i<=n;i++)
{
x=1;
for(k=0;k<=i;k++)
{
cout << x << '\t';
x = x * (i - k) / (k + 1);
}
cout << endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
如何更改它以便它只显示第n行而不是整个三角形?TIA.