How to cast an object in Objective-C

后端 未结 5 778
死守一世寂寞
死守一世寂寞 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:50

    ((SelectionListViewController *)myEditController).list
    

    More examples:

    int i = (int)19.5f; // (precision is lost)
    id someObject = [NSMutableArray new]; // you don't need to cast id explicitly
    

提交回复
热议问题