UIButtonから次のUITtableviewcontrollerに文字列を送信します。文字列はUIButtonタイトル(月曜日...日曜日)であり、NSPredicateがテーブル情報を日ごとにフィルタリングするために使用します。
@property (nonatomic, weak) NSString *dayOTW;
- (IBAction)selectDay:(UIButton *)sender {
UIButton *dayW = sender;
dayOTW = dayW.titleLabel.text;
NSLog(@"button press = %@", dayOTW);
}
2012-05-01 06:23:21.731 passingdata[99957:fb03] button press = Monday
そして私の次の画面にセグエ
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"SendWeekDay"])
{
// Get reference to the destination view controller
ViewController *vc = [segue destinationViewController];
// Pass any objects to the view controller here, like...
vc.dayOTW = dayOTW;
}
}
初めてボタンを選択したとき、テーブルに情報が表示されません。戻ってボタンをもう一度選択すると、テーブルにその日の正しい情報が表示されます。
私が間違っていることは何ですか?
上記に関連するもう1つの質問。週の各日に7つのUIButtonがありますが、1つのセグエですべてのUIButtonからどのようにセグエできますか?
ありがとう