开发者

Problem with class_getInstanceSize

开发者 https://www.devze.com 2023-01-08 05:37 出处:网络
I have my class derived from UITabBar: @inte开发者_JAVA技巧rface MyTabBar : UITabBar @end @implementation MyTabBar

I have my class derived from UITabBar:

@inte开发者_JAVA技巧rface MyTabBar : UITabBar
@end

@implementation MyTabBar
@end

Further, in my code, I call class_getInstanceSize for my class and system UITabBar class:

size_t origSize = class_getInstanceSize([UITabBar class]);
size_t mySize   = class_getInstanceSize([MyTabBar class]);

I use iOS SDK 4.1. When I run on iPhone Simulator (iPhone 4) i get the same value for origSize and mySize. But if I run on real device with SDK 3.1.3 I get different values, 68 for origSize and 80 for mySize. How can it be?


Most likely they changed the implementation of subclassing behind the scenes. You should log the return of class for each OS to find out if your still dealing with the same class behind the scenes. Chances are good that you are not. They may be in the process of migrating one class to another in a class cluster.

0

精彩评论

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