Hello World アプリを作成し、次のコードを...ViewController.mに追加しました。
- (void)viewDidLoad {
[super viewDidLoad];
CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
networkInfo.subscriberCellularProviderDidUpdateNotifier = ^(CTCarrier *carrier) {
[[[UIAlertView alloc] initWithTitle:@"SIM Alert"
message:@"This is an alert."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] show];
};
}
その後、SIM カードを取り外しましたが、期待どおりにアラートは表示されませんでした。誰かが親切に何が悪いのか教えてもらえますか? ありがとう。