我想知道是否有办法将像 UITableViewStylePlain 这样的常量传递给 NSDictionary。
我使用 NSValue 传递值类型,如下所示:
CGRect myRec = CGRectMake(0,0,320,568);
NSDictionary *myDic = @{@"val":[NSValue valueWithCGRect:myRec]};
CGRect yourRec = [[myDic valueForKey:@"val"] CGRectValue];
我的问题是如何为 UITableViewStylePlain 之类的常量执行此操作?像这样的东西:
NSDictionary *myDic = @{@"style":[NSValue value:UITableViewStylePlain withObjCType:enum]};
我意识到 enum 不是 ObjectiveC 类型... :(