私が何を求めているのかを尋ねる多くの質問を見つけましたが、まだ自分のソリューションを実装できていません。
UITableViewController に 2 つのセクションがあり、これまでのところすべてがうまく機能しています。私は AlarmEnabled UISwitch と、起動日などを選択できるように UIActionSheet をプルアップする AlarmDate セルを持っています。 "リアルタイム"。これは機能しますが、a) UISwitch を無効にする b) UIButton のキャンセル/保存でビューを終了する c) ビューに再度入る。
これまで、次のように tableView:reloadRowsAtIndexPath: メソッドを試しました。
NSIndexPath *tempIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
NSArray *tempIndexPathArray = [[NSArray alloc] initWithObjects:tempIndexPath, nil];
[self.tableView reloadRowsAtIndexPaths:tempIndexPathArray withRowAnimation:UITableViewRowAnimationNone];
[tempIndexPathArray release];
おそらく、iOS プログラミングとのオンオフ関係のために、そのコードをどこに配置すべきか (現在は AlarmEnabled UISwitch アクセサリのセレクター内に配置されている) を誤解しているだけですが、それは私が求めていることを実行しません (しかし、そのように聞こえます)正しく使用する必要があります)。
認知度を上げて、UISwitch のセレクターで次のようなことを試してみようと思いました。
#define NOT(a) !a
....
UITableViewCell *tempCellAlarmDate = [self.tableViewController.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
tempCellAlarmDate.userInteractionEnabled = NOT(tempCellAlarmDate.userInteractionEnabled);
// forget transparency for now.
//tempCellAlarmDate.alpha = 0.0;
.. しかし、私の頭蓋骨のダイナモに電力を供給している齧歯動物は、このコードを承認しないため、リアルタイムで userInteractionEnabled を切り替えるという私の夢は実現しません。
どんなアドバイスでも大歓迎です:-)
ありがとう
sc。