0

新しい日新しい問題だと思います。

5 つのボタンを含む JASidePanel を使用しています。各ボタンは変数の値を変更します。この変数は、MyTableController.m で parseClassName として使用されます。

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom the table

        // The className to query on
        if (_sDay==Nil) {
            self.parseClassName = @"Montag";
        }else{
        self.parseClassName = self.sDay;
        }
        // The key of the PFObject to display in the label of the default cell style
        self.textKey = @"Fach";

        // Whether the built-in pull-to-refresh is enabled
        self.pullToRefreshEnabled = YES;

        // Whether the built-in pagination is enabled
        self.paginationEnabled = NO;

        // The number of objects to show per page
        self.objectsPerPage = 5;
    }
    return self;
}




- (void)viewDidLoad {
    [super viewDidLoad];

    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hintergrund"]];
    imageView .frame = CGRectMake(0,0,255,458);
    [self.view addSubview:imageView];


    CGRect frameBtn = CGRectMake(0.0f, 0.0f, 254.0f, 50.0f);
    self.bMonday = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.bMonday setBackgroundImage:[UIImage imageNamed:@"button_rechts_1"] forState:UIControlStateNormal];
    [self.bMonday setTitle:@"Montag" forState:UIControlStateNormal];
    [self.bMonday setFrame:frameBtn];
    [self.bMonday addTarget:self
                     action:@selector(monday:)
                 forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.bMonday];



    CGRect frameBtn2 = CGRectMake(0.0f, 50.0f, 254.0f, 50.0f);
    self.bTuesday  = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.bTuesday setBackgroundImage:[UIImage imageNamed:@"button_rechts_1"] forState:UIControlStateNormal];
    [self.bTuesday setTitle:@"Dienstag" forState:UIControlStateNormal];
    [self.bTuesday setFrame:frameBtn2];
    [self.bTuesday addTarget:self
                      action:@selector(tuesday:)
           forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:self.bTuesday];


    CGRect frameBtn3 = CGRectMake(0.0f, 100.0f, 254.0f, 50.0f);
    self.bWendsday = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.bWendsday setBackgroundImage:[UIImage imageNamed:@"button_rechts_1"] forState:UIControlStateNormal];
    [self.bWendsday setTitle:@"Mittwoch" forState:UIControlStateNormal];
    [self.bWendsday setFrame:frameBtn3];
    [self.bWendsday addTarget:self
                       action:@selector(wendsday:)
           forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:self.bWendsday];


    CGRect frameBtn4 = CGRectMake(0.0f, 150.0f, 254.0f, 50.0f);
    self.bThursday = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.bThursday setBackgroundImage:[UIImage imageNamed:@"button_rechts_1"] forState:UIControlStateNormal];
    [self.bThursday setTitle:@"Donnerstag" forState:UIControlStateNormal];
    [self.bThursday setFrame:frameBtn4];
    [self.bThursday addTarget:self
                       action:@selector(thursday:)
           forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:self.bThursday];


    CGRect frameBtn5 = CGRectMake(0.0f, 200.0f, 254.0f, 50.0f);
    self.bFriday = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.bFriday setBackgroundImage:[UIImage imageNamed:@"button_rechts_1"] forState:UIControlStateNormal];
    [self.bFriday setTitle:@"Freitag" forState:UIControlStateNormal];
    [self.bFriday setFrame:frameBtn5];
    [self.bFriday addTarget:self
                     action:@selector(friday:)
           forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:self.bFriday];






}

-(void)monday:(id)sender {

    UINavigationController *navController = (UINavigationController*) self.sidePanelController.centerPanel;

    MyTableController *myNewTableController = (MyTableController*)[navController.viewControllers objectAtIndex:0];
    myNewTableController.sDay = @"Montag";
    NSLog(@"%@",myNewTableController.sDay);

}

-(void)tuesday:(id)sender {

    UINavigationController *navController = (UINavigationController*) self.sidePanelController.centerPanel;

    MyTableController *myNewTableController = (MyTableController*)[navController.viewControllers objectAtIndex:0];
    myNewTableController.sDay = @"Dienstag";
    NSLog(@"%@",myNewTableController.sDay);


}
-(void)wendsday:(id)sender {

    UINavigationController *navController = (UINavigationController*) self.sidePanelController.centerPanel;

    MyTableController *myNewTableController = (MyTableController*)[navController.viewControllers objectAtIndex:0];
    myNewTableController.sDay = @"Mittwoch";
    NSLog(@"%@",myNewTableController.sDay);


}
-(void)thursday:(id)sender {

    UINavigationController *navController = (UINavigationController*) self.sidePanelController.centerPanel;

    MyTableController *myNewTableController = (MyTableController*)[navController.viewControllers objectAtIndex:0];
    myNewTableController.sDay = @"Donnerstag";
    NSLog(@"%@",myNewTableController.sDay);


}
-(void)friday:(id)sender {

    UINavigationController *navController = (UINavigationController*) self.sidePanelController.centerPanel;

    MyTableController *myNewTableController = (MyTableController*)[navController.viewControllers objectAtIndex:0];
    myNewTableController.sDay = @"Freitag";
    NSLog(@"%@",myNewTableController.sDay);


}

問題は、PFQueryUITableView が新しい parseClass のコンテンツを表示していないことです。だれかが理由を知っていますか? よろしくお願いします!

4

1 に答える 1