@implementation ファイルに次のような定数文字列が定義されています。
static NSString * const contentDisplayDateKeyPath = @"content.display_date";
static NSString * const contentIDKeyPath = @"content.id";
実行時に変数の名前を保持する文字列を使用して contentDisplayDateKeyPath の内容を取得できますか?
元:
NSString *constantName = @"contentDisplayDateKeyPath"
[self valueForKey:constantName]
次に、 content.display_date を取得します
これは達成できますか?
CFBundleGetDataPointer を使用してこれを達成しようとしています
CFBundleRef mainBundle = CFBundleGetBundleWithIdentifier(CFBridgingRetain([[NSBundle mainBundle] bundleIdentifier]));
void *stringPointer = CFBundleGetDataPointerForName(mainBundle, CFBridgingRetain(obj));
NSString *string = (__bridge NSString *)stringPointer;
ただし、stringPointer は常に null です。
手伝ってくれてありがとう