How to cast an object in Objective-C

后端 未结 5 767
死守一世寂寞
死守一世寂寞 2020-12-04 09:14

Is there a way to cast objects in objective-c much like the way objects are cast in VB.NET?

For example, I am trying to do the following:

// create t         


        
5条回答
  •  無奈伤痛
    2020-12-04 09:42

    Remember, Objective-C is a superset of C, so typecasting works as it does in C:

    myEditController = [[SelectionListViewController alloc] init];
    ((SelectionListViewController *)myEditController).list = listOfItems;
    

提交回复
热议问题