开发者

Setting the UILabel text from one UIControllverView to another UIControllerView before pushing it on navigation controller

开发者 https://www.devze.com 2023-03-04 22:15 出处:网络
This is what I am trying to do. MyViewController *viewController = [[MyViewController alloc] initWithNibName:@\"MyViewController\" bundle:nil];

This is what I am trying to do.

MyViewController *viewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
        UILabel *lblTempStoreNo = [[UILabel alloc] init];
        [lblTempStoreNo setText:@"1234"];
        viewController.lblStoreNo = lblTempStoreNo;
        [activeRouteTicketListView setLblStoreNo:lblTempStoreNo];
        [[self navigationController] pushViewController:viewController animated:YES];

        [lblTempStoreNo release];
        [viewController release];

Basically I am setting the label in the view controller which I am about to push on navigation controller, but the value of that label is no开发者_运维知识库t changing :@. I was wondering if this is even possible?


You are changing the label, and not the text of the label. Shouldn't your code be:

viewController.lblStoreNo.text = @"1234";

?

0

精彩评论

暂无评论...
验证码 换一张
取 消