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.
只是好奇,我如何将此结构存储到属性中
void CGContextAddCurveToPoint ( CGContextRef c, CGFloat cp1x, CGFloat cp1y, CGFloat cp2x, CGFloat cp2y, CGFloat x, CGFloat y );
喜欢
@property (strong, nonatomic) void ??
您在问题中提出的不是 astruct它是method.
struct
method
但可以执行以下操作。首先声明一个结构:
typedef struct { CGContextRef c; CGFloat cp1x; CGFloat cp1y; CGFloat cp2x; CGFloat cp2y; CGFloat x; CGFloat y; } yourStruct;
然后声明一个属性,其类型规范为yourStruct
yourStruct
例如:@property yourStruct yourPropertyName;
@property yourStruct yourPropertyName;