Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通过子类化 NSView 创建了一个时钟。现在我想以编程方式创建许多时钟并将时区值传递给每个时钟。我如何将所需的 timeZone 值传递给 subClassed NSview。
只需在类的 .h 中创建一个变量:
@property (nonatomic, strong) NSString *timeZone
并在您创建时钟的地方引用它:
myNewClock.timezone = "GMT"