I sending a String from a UIButton to my next UITtableviewcontroller, the string is the UIButton Title (Monday ... Sunday) the string is used by the NSPredicate to filter my table information by day.
@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
And segue to my next screen
- (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;
}
}
the first time I select the button no information is show in my table , if I go back and select the button again my table show with the correct information for that day .
what i am doing wrong ?
one more question related to the above . I have 7 UIButtons one for each day on the week, how can segue from all the UIButtons with one segue ?
Thanks