- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if (myArray==NULL) {
        NSLog(@"its empty");
    } else {
        NSLog(@"not empty ");
    }

    filterViewController *destViewController = [segue destinationViewController];
    NSString *string1 = myArray;
    NSString *asd =@"asd";
    destViewController.searchText =myString;
    destViewController.myLabel.text=myString;
    destViewController.deneme4=myString;
}

this is my segue method.i imported and even erased the line where i check for segue identifier.

i initalized myString and successfully set it to another string where i segue and printed it with NSLog but i can't segue the same text to a TextView or even Label.

Where am i doing wrong?

My ultimate goal was to segue the content of my array where i fill it with this code

cell.cellLabel.text =[myArray objectAtIndex:indexPath.row];

the content is right and not null. I checked. How can i make the content of this array to the text of textview. Thnx

有帮助吗?

解决方案

You can't, and you shouldn't, try to alter another view controller's views. That's bad design, and frequently doesn't work. You should treat a view controller's views as private to the view controller.

You have the right idea setting up string properties in the destination view controller and setting those. Then in the destination view controller's viewWillAppear:animated method, install the text into the views as desired.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top