考虑这段代码:
CGFloat largerLineSpacing = kStreamCellParagraphSpacing;
CTParagraphStyleSetting paragraphSettings[1] = {
{ kCTParagraphStyleSpecifierParagraphSpacing, sizeof(CGFloat), &largerLineSpacing }
};
CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(paragraphSettings, sizeof(*paragraphSettings));
此代码在 iPad 1 (5.1) 上运行时崩溃并出现 EXC_BAD_ACCESS,但在 5.1 模拟器或 iPad 3 (6.0) 上运行时不会。我的 C 很弱 - 我在 sizeof 上犯了一个愚蠢的错误吗?