“Invalid application of 'sizeof' to interface 'Fraction' in non-fragile ABI” in Objective-C

前端 未结 2 570
刺人心
刺人心 2020-12-12 01:43

I\'m studying Steven Kochan\'s \"Programming in Objective-C 2.0\". We created a Fraction object with two int instance variables. Later in the book Kochan uses the sizeof sta

2条回答
  •  借酒劲吻你
    2020-12-12 01:47

    To follow up on what Chuck said, you should use class_getInstanceSize() at runtime if you really need to know the size of an object.

提交回复
热议问题