0
1

More than 3 years have passed since last update.

ObjCClassで参照できるクラスを一覧に出す

Posted at

SceneKit などのように ObjCClass を使って利用できる Objective-C や swift 用のクラスってどのようなものがあるのか知りたくて調べました。

print_classlist.py

# Python3.6
# List the names of all loaded Objective-C classes.

import objc_util

count = objc_util.objc_getClassList(None, 0)
print( '%d classes found:' % count )

classes = (objc_util.c_void_p * count)()
count = objc_util.objc_getClassList(classes, count)

class_names = []
for cls in classes:
    class_names.append(objc_util.class_getName(cls))

class_names.sort()

for b_name in class_names:
    name = b_name.decode('utf-8')
    #if not 'SCN' in name:
    #   continue
    print(name)

print('finished.')

実行すると3万以上のクラス名が print されるので、適当に絞り込むとかするのが良いと思います。

参考サイト

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1