{"id":247,"date":"2026-09-06T00:43:56","date_gmt":"2026-09-05T16:43:56","guid":{"rendered":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/interview-ios-core\/"},"modified":"2026-09-06T00:43:56","modified_gmt":"2026-09-05T16:43:56","slug":"interview-ios-core","status":"publish","type":"post","link":"https:\/\/www.ziliaochi.cn\/index.php\/2026\/09\/06\/interview-ios-core\/","title":{"rendered":"iOS \u9762\u8bd5\u9ad8\u9891 25 \u95ee\uff1aRuntime\u3001RunLoop\u3001\u5185\u5b58\u7ba1\u7406\u4e0e SwiftUI"},"content":{"rendered":"<div style=\"font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",sans-serif;font-size:16.5px;line-height:1.9;color:#35435c;letter-spacing:.2px\">\n<div style=\"background:linear-gradient(135deg,#f5f9ff,#eef5ff);border:1px solid #dce8f8;border-left:4px solid #7c6cf0;border-radius:12px;padding:16px 20px;margin:0 0 24px;font-size:14.5px;color:#3d5570;line-height:2\"><span style=\"display:inline-block;background:#7c6cf0;color:#fff;font-size:12.5px;font-weight:700;padding:3px 10px;border-radius:6px;margin-right:12px;letter-spacing:1px;vertical-align:1px\">\u5173\u952e\u8bcd<\/span>iOS \u9762\u8bd5\u3001Objective-C Runtime\u3001\u6d88\u606f\u8f6c\u53d1\u3001RunLoop\u3001ARC\u3001SwiftUI<\/div>\n<div style=\"background:#fafbfd;border:1px solid #e8edf5;border-radius:12px;padding:18px 22px;margin:0 0 30px\">\n<div style=\"font-size:13.5px;font-weight:700;color:#8a99ae;letter-spacing:2px;margin-bottom:12px\">\u76ee\u5f55<\/div>\n<ol style=\"margin:0;padding-left:20px\">\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-1\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e00\u3001Runtime\uff1aObjective-C \u7684\u52a8\u6001\u6027\u4ece\u54ea\u6765<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-2\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e8c\u3001\u5185\u5b58\u7ba1\u7406\uff1aARC \u5230\u5e95\u505a\u4e86\u4ec0\u4e48<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-3\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e09\u3001RunLoop\uff1a\u4e8b\u4ef6\u5faa\u73af\u7684\u9aa8\u67b6<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-4\" style=\"color:#42546e;text-decoration:none;border:none\">\u56db\u3001Block \u4e0e GCD<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-5\" style=\"color:#42546e;text-decoration:none;border:none\">\u4e94\u3001SwiftUI\uff1a2026 \u5e74\u7684\u5fc5\u8003\u533a<\/a><\/li>\n<li style=\"margin:8px 0;font-size:15px;line-height:1.6\"><a href=\"#sec-6\" style=\"color:#42546e;text-decoration:none;border:none\">\u516d\u3001\u5c0f\u7ed3<\/a><\/li>\n<\/ol>\n<\/div>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><span style=\"font-size:17px;color:#1e2f47\">iOS \u9762\u8bd5\u7684\u539f\u7406\u9898\u6709\u51e0\u4e2a&#8221;\u7ecf\u5178\u5f97\u4e0d\u80fd\u518d\u7ecf\u5178&#8221;\u7684\u8003\u70b9\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">Runtime\u3001RunLoop\u3001\u5185\u5b58\u7ba1\u7406\uff08ARC\uff09\u3001Block\u3001\u54cd\u5e94\u94fe\u3001SwiftUI<\/strong>\u3002\u8fd9\u4e9b\u5e38\u5e74\u4e0d\u53d8\uff0c\u4f46\u8003\u5bdf\u6df1\u5ea6\u5dee\u5f02\u6781\u5927\u2014\u2014\u540c\u6837\u95ee&#8221;weak \u7684\u5b9e\u73b0\u539f\u7406&#8221;\uff0c\u6709\u4eba\u53ea\u7b54&#8221;\u81ea\u52a8\u7f6e nil&#8221;\uff0c\u6709\u4eba\u80fd\u8bb2\u6e05 <strong style=\"color:#0f1c2e;font-weight:600\">SideTable \u4e0e\u5f31\u5f15\u7528\u8868<\/strong>\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u672c\u6587\u9010\u9898\u7ed9\u51fa\u6807\u51c6\u7b54\u6cd5\u3001\u8ffd\u95ee\u9677\u9631\u548c\u90a3\u53e5&#8221;\u9762\u8bd5\u5b98\u60f3\u542c\u7684\u8bdd&#8221;\u3002\u7248\u672c\u80cc\u666f\uff1aiOS 27 \u5904\u4e8e\u53d1\u5e03\u7a97\u53e3\uff0cSwift \u4e0e SwiftUI \u7684\u8fed\u4ee3\u8282\u594f\u5df2\u8d8b\u7a33\u3002<\/p>\n<figure style=\"margin:30px 0;text-align:center\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"900\" src=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-ios-core-fig.png\" alt=\"\u6d88\u606f\u8f6c\u53d1\u7684\u4e09\u4e2a\u9636\u6bb5\" class=\"wp-image-246\" style=\"max-width:100%;height:auto;border-radius:12px;border:1px solid #e6ecf4;box-shadow:0 8px 24px rgba(15,30,60,.07)\" srcset=\"https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-ios-core-fig.png 1200w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-ios-core-fig-300x225.png 300w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-ios-core-fig-1024x768.png 1024w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-ios-core-fig-768x576.png 768w, https:\/\/www.ziliaochi.cn\/wp-content\/uploads\/2026\/09\/interview-ios-core-fig-800x600.png 800w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><figcaption style=\"margin-top:12px;font-size:13.5px;color:#7b8aa0;text-align:center;line-height:1.75\">OC \u6d88\u606f\u8f6c\u53d1\uff1a\u52a8\u6001\u65b9\u6cd5\u89e3\u6790 \u2192 \u5907\u63f4\u63a5\u6536\u8005 \u2192 \u5b8c\u6574\u8f6c\u53d1<\/figcaption><\/figure>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #7c6cf0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-1\">\u4e00\u3001Runtime\uff1aObjective-C \u7684\u52a8\u6001\u6027\u4ece\u54ea\u6765<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q1\uff1a\u4ec0\u4e48\u662f Runtime\uff1f\u6d88\u606f\u53d1\u9001\u7684\u5b8c\u6574\u8fc7\u7a0b\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">Objective-C \u7684\u65b9\u6cd5\u8c03\u7528<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u662f\u76f4\u63a5\u7684\u51fd\u6570\u5730\u5740\u8df3\u8f6c\uff0c\u800c\u662f\u6d88\u606f\u53d1\u9001<\/strong>\u3002\u7f16\u8bd1\u5668\u4f1a\u628a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">[obj doSomething]<\/code> \u8f6c\u6210\uff1a<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">objc_msgSend(obj, @selector(doSomething))\n\n\/\/ \u5176\u6267\u884c\u8def\u5f84\uff08\u7b80\u5316\uff09\uff1a\n\/\/ 1. \u5feb\u901f\u67e5\u627e\uff1a\u5230 receiver \u6240\u5c5e\u7c7b\u7684 cache\uff08\u65b9\u6cd5\u7f13\u5b58\u54c8\u5e0c\u8868\uff09\u91cc\u627e IMP\n\/\/    \u2192 \u547d\u4e2d\u5219\u76f4\u63a5\u8df3\u8f6c\n\/\/ 2. \u6162\u901f\u67e5\u627e\uff1a\u7f13\u5b58\u6ca1\u547d\u4e2d\uff0c\u8d70 lookUpImpOrForward\n\/\/    \u2192 \u5728\u672c\u7c7b\u7684 method_list \u91cc\u4e8c\u5206\/\u7ebf\u6027\u67e5\u627e\n\/\/    \u2192 \u6ca1\u627e\u5230\u5219\u6cbf superclass \u94fe\u4e00\u8def\u5411\u4e0a\uff0c\u76f4\u5230 NSObject\n\/\/ 3. \u4ecd\u672a\u627e\u5230 \u2192 \u8fdb\u5165\"\u6d88\u606f\u8f6c\u53d1\"\u4e09\u9636\u6bb5<\/code><\/pre>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5173\u952e\u70b9\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u65b9\u6cd5\u89e3\u6790\u53d1\u751f\u5728\u8fd0\u884c\u65f6\uff0c\u4e0d\u662f\u7f16\u8bd1\u65f6<\/strong>\u3002\u8fd9\u5c31\u662f OC \u52a8\u6001\u6027\u7684\u6765\u6e90\u2014\u2014\u4f60\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u7ed9\u7c7b\u52a0\u65b9\u6cd5\u3001\u4ea4\u6362\u5b9e\u73b0\uff08Method Swizzling\uff09\u3001\u751a\u81f3\u5728\u6d88\u606f\u8f6c\u53d1\u9636\u6bb5\u628a\u6d88\u606f\u8f6c\u7ed9\u522b\u7684\u5bf9\u8c61\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q2\uff1a\u6d88\u606f\u8f6c\u53d1\u7684\u4e09\u4e2a\u9636\u6bb5\uff1f<\/h3>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u52a8\u6001\u65b9\u6cd5\u89e3\u6790<\/strong>\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">+resolveInstanceMethod:<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">+resolveClassMethod:<\/code>\u3002\u7ed9\u4e00\u6b21\u673a\u4f1a<strong style=\"color:#0f1c2e;font-weight:600\">\u52a8\u6001\u6dfb\u52a0\u65b9\u6cd5\u5b9e\u73b0<\/strong>\uff08<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">class_addMethod<\/code>\uff09\u3002\u5e38\u7528\u4e8e <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@dynamic<\/code> \u5c5e\u6027\u7684\u60f0\u6027\u5b9e\u73b0\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5907\u63f4\u63a5\u6536\u8005<\/strong>\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">-forwardingTargetForSelector:<\/code>\u3002\u8fd4\u56de\u53e6\u4e00\u4e2a\u80fd\u5904\u7406\u8be5\u6d88\u606f\u7684\u5bf9\u8c61\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u8fd9\u662f\u4e09\u4e2a\u6b65\u9aa4\u91cc\u4ee3\u4ef7\u6700\u4f4e\u7684<\/strong>\uff0c\u53ea\u662f\u91cd\u5b9a\u5411\uff0c\u4e0d\u521b\u5efa NSInvocation\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5b8c\u6574\u8f6c\u53d1<\/strong>\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">-methodSignatureForSelector:<\/code> \u8fd4\u56de\u65b9\u6cd5\u7b7e\u540d\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">-forwardInvocation:<\/code> \u62ff\u5230 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSInvocation<\/code> \u505a\u4efb\u610f\u5904\u7406\uff08\u8f6c\u53d1\u7ed9\u591a\u4e2a\u5bf9\u8c61\u3001\u8bb0\u5f55\u65e5\u5fd7\u3001\u541e\u6389\uff09\u3002<\/li>\n<\/ol>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u9636\u6bb5 2\uff1a\u5feb\u901f\u8f6c\u53d1\uff08\u6027\u80fd\u6700\u597d\uff09\n- (id)forwardingTargetForSelector:(SEL)aSelector {\n    if (aSelector == @selector(heavyCompute)) {\n        return self.computeEngine;   \/\/ \u4ea4\u7ed9\u522b\u4eba\u5e72\n    }\n    return [super forwardingTargetForSelector:aSelector];\n}\n\n\/\/ \u9636\u6bb5 3\uff1a\u5b8c\u6574\u8f6c\u53d1\uff08\u53ef\u5e94\u5bf9\u672a\u5b9e\u73b0\u5d29\u6e83\u7684\u515c\u5e95\uff09\n- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {\n    return [NSMethodSignature signatureWithObjCTypes:\"v@:\"];\n}\n- (void)forwardInvocation:(NSInvocation *)invocation {\n    NSLog(@\"\u672a\u5b9e\u73b0\u7684\u65b9\u6cd5\uff1a%@\", NSStringFromSelector(invocation.selector));\n}<\/code><\/pre>\n<blockquote style=\"margin:24px 0;padding:16px 22px;background:#f7fafd;border-left:4px solid #7c6cf0;border-radius:0 10px 10px 0;color:#4a5b73;font-size:15.6px;line-height:1.88\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u52a0\u5206\u70b9\uff1a\u5f88\u591a&#8221;\u9632\u5d29\u6e83&#8221;\u65b9\u6848\u5c31\u662f\u5728<strong style=\"color:#0f1c2e;font-weight:600\">\u9636\u6bb5 3<\/strong> \u515c\u5e95\u3002\u4f46\u8981\u4e3b\u52a8\u8bf4\u660e\u4ee3\u4ef7\u2014\u2014<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSInvocation<\/code> \u7684\u521b\u5efa\u5f00\u9500\u8f83\u5927\uff0c\u4e14<strong style=\"color:#0f1c2e;font-weight:600\">\u63a9\u76d6\u95ee\u9898\u4e0d\u7b49\u4e8e\u89e3\u51b3\u95ee\u9898<\/strong>\uff0c\u7ebf\u4e0a\u5e94\u5f53\u914d\u5408\u4e0a\u62a5\uff0c\u4e0d\u80fd\u9ed8\u9ed8\u541e\u6389\u3002<\/p>\n<\/blockquote>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q3\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">isKindOfClass<\/code> \u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">isMemberOfClass<\/code> \u7684\u533a\u522b\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">isKindOfClass:<\/code> \u5224\u65ad\u5bf9\u8c61<strong style=\"color:#0f1c2e;font-weight:600\">\u662f\u5426\u4e3a\u8be5\u7c7b\u6216\u5176\u5b50\u7c7b\u7684\u5b9e\u4f8b<\/strong>\uff08\u6cbf\u7ee7\u627f\u94fe\u6bd4\u8f83\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">isMemberOfClass:<\/code> \u53ea\u5224\u65ad<strong style=\"color:#0f1c2e;font-weight:600\">\u662f\u5426\u6070\u597d\u662f\u8be5\u7c7b\u7684\u5b9e\u4f8b<\/strong>\uff08\u53ea\u6bd4\u8f83\u5f53\u524d\u7c7b\uff09\u3002<\/li>\n<\/ul>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6709\u4e2a\u7ecf\u5178\u9677\u9631\u9898\uff1a\u5bf9<strong style=\"color:#0f1c2e;font-weight:600\">\u7c7b\u5bf9\u8c61<\/strong>\u8c03\u7528\u65f6\u4f1a\u8d70\u5143\u7c7b\uff08meta class\uff09\u94fe\u3002\u7b54\u8fd9\u7c7b\u9898\u65f6\u8981\u5206\u6e05<strong style=\"color:#0f1c2e;font-weight:600\">&#8220;\u5b9e\u4f8b\u65b9\u6cd5\u7248\u672c\u8d70\u7c7b\u94fe\uff0c\u7c7b\u65b9\u6cd5\u7248\u672c\u8d70\u5143\u7c7b\u94fe&#8221;<\/strong>\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q4\uff1aCategory \u548c Extension \u7684\u533a\u522b\uff1f<\/h3>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;border:1px solid #e3eaf3;border-radius:10px;overflow:hidden\">\n<thead>\n<tr>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u7ef4\u5ea6<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">Category\uff08\u5206\u7c7b\uff09<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">Extension\uff08\u6269\u5c55\/\u533f\u540d\u5206\u7c7b\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u7f16\u8bd1\u65f6\u673a<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u8fd0\u884c\u65f6\u5408\u5e76\u8fdb\u7c7b<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u7f16\u8bd1\u65f6<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u80fd\u5426\u52a0\u5c5e\u6027<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u53ea\u80fd\u52a0\u65b9\u6cd5\u58f0\u660e\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u5c5e\u6027\u9700\u5173\u8054\u5bf9\u8c61<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u53ef\u4ee5\u52a0\u5b9e\u4f8b\u53d8\u91cf\u4e0e\u5c5e\u6027<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u9700\u8981\u6e90\u7801<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u4e0d\u9700\u8981<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u9700\u8981<\/strong>\uff08\u5199\u5728 .m \u91cc\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u5178\u578b\u7528\u9014<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u7ed9\u7cfb\u7edf\u7c7b\u52a0\u65b9\u6cd5\u3001\u62c6\u5206\u5927\u7c7b<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u9690\u85cf\u79c1\u6709\u65b9\u6cd5\u4e0e\u5c5e\u6027<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8ffd\u95ee&#8221;<strong style=\"color:#0f1c2e;font-weight:600\">Category \u7684\u540c\u540d\u65b9\u6cd5\u4f1a\u600e\u6837<\/strong>&#8220;\u2014\u2014<strong style=\"color:#0f1c2e;font-weight:600\">\u540e\u7f16\u8bd1\u7684 Category \u4f1a&#8221;\u8986\u76d6&#8221;\u5148\u7f16\u8bd1\u7684<\/strong>\uff08\u5b9e\u9645\u662f\u65b9\u6cd5\u5217\u8868\u987a\u5e8f\u9760\u524d\uff0c\u67e5\u627e\u65f6\u5148\u547d\u4e2d\uff09\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u8fd9\u4e2a\u884c\u4e3a\u662f\u4e0d\u786e\u5b9a\u7684\uff0c\u4e0d\u8981\u4f9d\u8d56\u5b83<\/strong>\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u7ed9\u7cfb\u7edf\u7c7b\u5199 Category \u65f6\u65b9\u6cd5\u540d<strong style=\"color:#0f1c2e;font-weight:600\">\u5fc5\u987b\u52a0\u524d\u7f00<\/strong>\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #7c6cf0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-2\">\u4e8c\u3001\u5185\u5b58\u7ba1\u7406\uff1aARC \u5230\u5e95\u505a\u4e86\u4ec0\u4e48<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q5\uff1aARC \u4e0b\u8fd8\u6709\u5185\u5b58\u6cc4\u6f0f\u5417\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u6709\uff0c\u800c\u4e14\u5f88\u5e38\u89c1\u3002<\/strong>ARC \u53ea\u662f\u81ea\u52a8\u7ba1\u7406&#8221;\u5f15\u7528\u8ba1\u6570&#8221;\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u5b83\u89e3\u51b3\u4e0d\u4e86\u5faa\u73af\u5f15\u7528<\/strong>\u3002\u4e09\u7c7b\u5178\u578b\u6cc4\u6f0f\uff1a<\/p>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5faa\u73af\u5f15\u7528<\/strong>\uff1a\u5bf9\u8c61\u4e92\u76f8\u5f3a\u5f15\u7528\uff0c\u6216\u5f62\u6210\u4e86\u73af\uff08A\u2192B\u2192C\u2192A\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">Block \u6355\u83b7 self<\/strong>\uff1aBlock \u5f3a\u5f15\u7528 self\uff0cself \u53c8\u6301\u6709\u8fd9\u4e2a Block\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5b9a\u65f6\u5668 \/ \u901a\u77e5\u672a\u6e05\u7406<\/strong>\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSTimer<\/code>\uff08iOS 10 \u524d\u7684 target-action \u5f62\u5f0f\uff09\u5f3a\u5f15\u7528 target\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NotificationCenter<\/code> \u7684 block \u5f0f\u89c2\u5bdf\u8005\u6301\u6709 self\u3002<\/li>\n<\/ol>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u5faa\u73af\u5f15\u7528\uff1aself -&gt; completion -&gt; self\nself.completion = ^{\n    [self doSomething];       \/\/ Block \u5f3a\u6355\u83b7 self\n};\n\n\/\/ \u89e3\u6cd5\uff1aweak-strong dance\n__weak typeof(self) weakSelf = self;\nself.completion = ^{\n    __strong typeof(weakSelf) strongSelf = weakSelf;\n    if (!strongSelf) return;              \/\/ \u5df2\u91ca\u653e\u5219\u76f4\u63a5\u8fd4\u56de\n    [strongSelf doSomething];             \/\/ \u4fdd\u8bc1\u6267\u884c\u671f\u95f4\u4e0d\u4f1a\u88ab\u91ca\u653e\n};\n\n\/\/ NSTimer\uff1aiOS 10+ \u7528 block \u7248 API\uff0c\u907f\u514d target \u88ab\u5f3a\u5f15\u7528\nself.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 repeats:YES block:^(NSTimer *t) {\n    [weakSelf tick];\n}];\n\/\/ \u5e76\u4e14\u8981\u5728 dealloc \/ viewWillDisappear \u91cc invalidate<\/code><\/pre>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q6\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">weak<\/code> \u4e3a\u4ec0\u4e48\u4f1a\u5728\u5bf9\u8c61\u91ca\u653e\u540e\u81ea\u52a8\u53d8\u6210 nil\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8fd9\u662f Runtime \u5c42\u9762\u7684\u4e00\u5f20\u8868\u5728\u8d77\u4f5c\u7528\u3002\u7b80\u5316\u540e\u7684\u7ed3\u6784\u662f\uff1a<\/p>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u7cfb\u7edf\u7ef4\u62a4\u82e5\u5e72\u5f20 <strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">SideTable<\/code><\/strong>\uff08\u5168\u5c40\u54c8\u5e0c\u8868\uff0c\u6309\u5bf9\u8c61\u5730\u5740\u5206\u6876\uff0c\u5e26\u9501\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u6bcf\u4e2a SideTable \u91cc\u6709 <strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">weak_table_t<\/code><\/strong>\uff1a\u4ee5\u5bf9\u8c61\u5730\u5740\u4e3a key\uff0cvalue \u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u6240\u6709\u6307\u5411\u5b83\u7684 weak \u6307\u9488\u5730\u5740\u7684\u96c6\u5408\uff08weak_entry_t\uff09<\/strong>\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u5bf9\u8c61\u91ca\u653e\u65f6\uff0cRuntime \u8d70 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">dealloc \u2192 objc_destructInstance \u2192 clearDeallocating<\/code>\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u67e5\u51fa\u8be5\u5bf9\u8c61\u5bf9\u5e94\u7684\u6240\u6709 weak \u6307\u9488\u5730\u5740\uff0c\u628a\u5b83\u4eec\u9010\u4e2a\u7f6e\u4e3a nil<\/strong>\uff0c\u7136\u540e\u4ece\u8868\u4e2d\u79fb\u9664\u8bb0\u5f55\u3002<\/li>\n<\/ul>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u6240\u4ee5 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">weak<\/code> \u7684\u4ee3\u4ef7\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u989d\u5916\u7684\u4e00\u6b21\u67e5\u8868\u4e0e\u7f6e nil \u64cd\u4f5c<\/strong>\uff0c\u6bd4 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">assign<\/code>\uff08\u4e0d\u7f6e nil\uff0c\u4f1a\u4ea7\u751f\u60ac\u5782\u6307\u9488\uff09\u5b89\u5168\u4f46\u7565\u6162\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q7\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">strong<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">copy<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">assign<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">weak<\/code> \u600e\u4e48\u9009\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">strong<\/code><\/strong>\uff1a\u9ed8\u8ba4\uff0c\u6301\u6709\u5bf9\u8c61\uff0c\u5f15\u7528\u8ba1\u6570 +1\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">copy<\/code><\/strong>\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u5efa\u7acb\u4e0d\u53ef\u53d8\u526f\u672c<\/strong>\u3002<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSString<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSArray<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSDictionary<\/code> \u5c5e\u6027<strong style=\"color:#0f1c2e;font-weight:600\">\u5fc5\u987b\u7528 copy<\/strong>\u2014\u2014\u5426\u5219\u4e00\u4e2a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSMutableString<\/code> \u8d4b\u8fdb\u6765\u540e\uff0c\u5916\u90e8\u6539\u52a8\u4f1a\u610f\u5916\u5f71\u54cd\u5c5e\u6027\u503c\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">assign<\/code><\/strong>\uff1a\u53ea\u505a\u7b80\u5355\u8d4b\u503c\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u7f6e nil<\/strong>\u3002\u7528\u4e8e<strong style=\"color:#0f1c2e;font-weight:600\">\u57fa\u672c\u6570\u636e\u7c7b\u578b<\/strong>\uff08int\u3001CGFloat\u3001\u7ed3\u6784\u4f53\uff09\u3002\u4fee\u9970\u5bf9\u8c61\u4f1a\u4ea7\u751f\u60ac\u5782\u6307\u9488\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">weak<\/code><\/strong>\uff1a\u4e0d\u6301\u6709\uff0c\u5bf9\u8c61\u91ca\u653e\u540e\u81ea\u52a8\u7f6e nil\u3002\u7528\u4e8e delegate\u3001IBOutlet \u5b50\u89c6\u56fe\u3001Block \u4e2d\u6253\u7834\u5faa\u73af\u5f15\u7528\u3002<\/li>\n<\/ul>\n<blockquote style=\"margin:24px 0;padding:16px 22px;background:#f7fafd;border-left:4px solid #7c6cf0;border-radius:0 10px 10px 0;color:#4a5b73;font-size:15.6px;line-height:1.88\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u9ad8\u9891\u8ffd\u95ee\uff1a&#8221;<strong style=\"color:#0f1c2e;font-weight:600\">delegate \u4e3a\u4ec0\u4e48\u7528 weak \u800c\u4e0d\u7528 strong\uff1f<\/strong>&#8220;\u2014\u2014\u56e0\u4e3a\u5178\u578b\u7ed3\u6784\u662f <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">Controller<\/code> \u6301\u6709 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">View<\/code>\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">View<\/code> \u7684 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">delegate<\/code> \u6307\u56de <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">Controller<\/code>\u3002\u82e5 delegate \u662f strong\uff0c\u5c31\u5f62\u6210\u4e86\u5faa\u73af\u5f15\u7528\uff0c\u4e24\u8005\u90fd\u91ca\u653e\u4e0d\u6389\u3002<\/p>\n<\/blockquote>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q8\uff1aAutoreleasePool \u4ec0\u4e48\u65f6\u5019\u91ca\u653e\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">autorelease<\/code> \u7684\u5bf9\u8c61\u88ab\u52a0\u5165\u5f53\u524d\u7684<strong style=\"color:#0f1c2e;font-weight:600\">\u81ea\u52a8\u91ca\u653e\u6c60<\/strong>\uff0c\u6c60\u5b50\u5728<strong style=\"color:#0f1c2e;font-weight:600\">\u4e00\u6b21 RunLoop \u8fed\u4ee3\u7ed3\u675f\u65f6<\/strong>\uff08\u5373\u5c06\u8fdb\u5165\u4f11\u7720\u524d\uff09\u88ab <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">pop<\/code>\uff0c\u6c60\u5185\u5bf9\u8c61\u6536\u5230\u4e00\u6b21 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">release<\/code>\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5b9e\u8df5\u4e2d\u771f\u6b63\u9700\u8981\u6ce8\u610f\u7684\u662f<strong style=\"color:#0f1c2e;font-weight:600\">\u5faa\u73af\u5185\u521b\u5efa\u5927\u91cf\u4e34\u65f6\u5bf9\u8c61<\/strong>\uff1a<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u53cd\u4f8b\uff1a\u767e\u4e07\u6b21\u5faa\u73af\u4ea7\u751f\u7684\u4e34\u65f6\u5bf9\u8c61\u5806\u79ef\u5230\u5faa\u73af\u7ed3\u675f\u624d\u91ca\u653e\uff0c\u5185\u5b58\u5cf0\u503c\u98d9\u5347\nfor (int i = 0; i &lt; 1000000; i++) {\n    NSString *s = [NSString stringWithFormat:@\"item-%d\", i];\n    \/\/ ...\n}\n\n\/\/ \u6b63\u4f8b\uff1a\u624b\u52a8\u52a0\u81ea\u52a8\u91ca\u653e\u6c60\uff0c\u53ca\u65f6\u91ca\u653e\nfor (int i = 0; i &lt; 1000000; i++) {\n    @autoreleasepool {\n        NSString *s = [NSString stringWithFormat:@\"item-%d\", i];\n        \/\/ ...\n    }\n}<\/code><\/pre>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #7c6cf0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-3\">\u4e09\u3001RunLoop\uff1a\u4e8b\u4ef6\u5faa\u73af\u7684\u9aa8\u67b6<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q9\uff1aRunLoop \u662f\u4ec0\u4e48\uff1f\u548c\u7ebf\u7a0b\u4ec0\u4e48\u5173\u7cfb\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">RunLoop \u662f\u4e00\u4e2a<strong style=\"color:#0f1c2e;font-weight:600\">\u4e8b\u4ef6\u5904\u7406\u5faa\u73af<\/strong>\uff1a\u6709\u4e8b\u4ef6\u5c31\u5904\u7406\uff0c\u6ca1\u4e8b\u4ef6\u5c31\u4f11\u7720\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u6bcf\u6761\u7ebf\u7a0b\u6700\u591a\u4e00\u4e2a RunLoop\uff0c\u4e3b\u7ebf\u7a0b\u9ed8\u8ba4\u5f00\u542f\uff0c\u5b50\u7ebf\u7a0b\u9ed8\u8ba4\u4e0d\u5f00\u542f<\/strong>\uff08\u9700\u8981\u624b\u52a8 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">[[NSRunLoop currentRunLoop] run]<\/code> \u6216\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">CFRunLoopRun()<\/code>\uff09\uff0c\u4e14\u5fc5\u987b\u81f3\u5c11\u6709\u4e00\u4e2a Source\/Timer\/Observer \u624d\u80fd\u7ef4\u6301\u8fd0\u884c\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u4e00\u6b21\u5faa\u73af\u7684\u6838\u5fc3\u6d41\u7a0b\uff1a<\/p>\n<ol style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u901a\u77e5 Observer\uff1a\u5373\u5c06\u8fdb\u5165 Loop<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u901a\u77e5 Observer\uff1a\u5373\u5c06\u5904\u7406 Timer \/ Source0<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u5904\u7406 Source0\uff08\u89e6\u6478\u4e8b\u4ef6\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">performSelector:onThread:<\/code>\uff09<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u82e5\u6709 Source1\uff08\u57fa\u4e8e mach port \u7684\u7aef\u53e3\u6d88\u606f\uff09\uff0c\u8df3\u5230\u7b2c 9 \u6b65<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u901a\u77e5 Observer\uff1a\u5373\u5c06\u4f11\u7720<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4f11\u7720\u7b49\u5f85<\/strong>\uff08\u5185\u6838\u6001\uff0c\u901a\u8fc7 mach_msg \u7b49\u5f85\u5524\u9192\uff0c\u4e0d\u5360 CPU\uff09<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u88ab\u67d0\u4e2a\u4e8b\u4ef6\u5524\u9192\uff08Timer \u5230\u70b9\u3001Source1 \u6d88\u606f\u3001GCD \u56de\u4e3b\u7ebf\u7a0b\u7b49\uff09<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u5904\u7406\u5524\u9192\u65f6\u6536\u5230\u7684\u6d88\u606f\uff0c\u56de\u5230\u7b2c 2 \u6b65<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\">\u901a\u77e5 Observer\uff1a\u5373\u5c06\u9000\u51fa Loop<\/li>\n<\/ol>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q10\uff1aRunLoop \u6709\u54ea\u4e9b\u5b9e\u9645\u5e94\u7528\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">NSTimer \u7cbe\u5ea6\u95ee\u9898<\/strong>\uff1aTimer \u4f9d\u8d56 RunLoop\uff0c\u82e5\u5f53\u524d\u6b63\u5728\u5904\u7406\u8017\u65f6\u4efb\u52a1\uff0cTimer \u4f1a\u88ab\u987a\u5ef6\uff1b\u6eda\u52a8 scrollView \u65f6 RunLoop \u5207\u5230 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">UITrackingRunLoopMode<\/code>\uff0c\u9ed8\u8ba4 mode \u4e0b\u7684 Timer \u4e0d\u89e6\u53d1\u2014\u2014\u89e3\u6cd5\u662f\u628a Timer \u52a0\u5230 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSRunLoopCommonModes<\/code>\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5e38\u9a7b\u7ebf\u7a0b<\/strong>\uff1a\u7ed9\u5b50\u7ebf\u7a0b\u52a0\u4e00\u4e2a <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSPort<\/code> \u5e76\u542f\u52a8 RunLoop\uff0c\u8ba9\u5b83\u4e0d\u9000\u51fa\uff08AFNetworking \u65e7\u7248\u672c\u7528\u8fd9\u4e2a\u6a21\u5f0f\u4fdd\u6d3b\u7f51\u7edc\u7ebf\u7a0b\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5361\u987f\u76d1\u63a7<\/strong>\uff1a\u5411\u4e3b\u7ebf\u7a0b RunLoop \u6ce8\u518c Observer\uff0c\u76d1\u542c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">kCFRunLoopBeforeSources<\/code> \u4e0e <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">kCFRunLoopAfterWaiting<\/code> \u4e4b\u95f4\u7684\u8017\u65f6\uff0c\u8d85\u65f6\u5373\u5224\u5b9a\u4e3a\u4e00\u6b21\u5361\u987f\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u6ed1\u52a8\u65f6\u5ef6\u8fdf\u52a0\u8f7d\u5927\u56fe<\/strong>\uff1a\u628a\u4efb\u52a1\u653e\u8fdb <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSDefaultRunLoopMode<\/code>\uff0c\u6eda\u52a8\u7ed3\u675f\uff08\u5207\u56de\u9ed8\u8ba4 mode\uff09\u540e\u518d\u6267\u884c\uff0c\u907f\u514d\u5f71\u54cd\u6eda\u52a8\u5e27\u7387\u3002<\/li>\n<\/ul>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q11\uff1aRunLoop \u7684 Mode \u6709\u4ec0\u4e48\u7528\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">Mode \u662f\u4e00\u7ec4<strong style=\"color:#0f1c2e;font-weight:600\">\u300cSource \/ Timer \/ Observer \u7684\u96c6\u5408\u300d<\/strong>\uff0cRunLoop \u540c\u4e00\u65f6\u523b\u53ea\u80fd\u8fd0\u884c\u5728\u67d0\u4e00\u4e2a Mode \u4e0b\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u53ea\u4f1a\u5904\u7406\u5f53\u524d Mode \u91cc\u7684\u4e8b\u4ef6<\/strong>\u3002\u8fd9\u79cd\u8bbe\u8ba1\u662f\u4e3a\u4e86<strong style=\"color:#0f1c2e;font-weight:600\">\u9694\u79bb\u4e0d\u540c\u573a\u666f\u7684\u4e8b\u4ef6\u6e90<\/strong>\u2014\u2014\u6ed1\u52a8\u65f6\u53ea\u5173\u5fc3\u89e6\u6478\uff0c\u5c31\u4e0d\u53bb\u5904\u7406\u9ed8\u8ba4\u6a21\u5f0f\u4e0b\u7684\u5b9a\u65f6\u5668\u4e0e\u7f51\u7edc\u56de\u8c03\uff0c\u4ece\u800c\u4fdd\u8bc1\u6eda\u52a8\u4f18\u5148\u7ea7\u7684\u5e27\u7387\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5e38\u89c1 Mode\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">kCFRunLoopDefaultMode<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">UITrackingRunLoopMode<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">NSRunLoopCommonModes<\/code>\uff08\u6ce8\u610f\uff1aCommonModes <strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u662f\u4e00\u4e2a\u771f\u6b63\u7684 Mode<\/strong>\uff0c\u800c\u662f\u4e00\u7ec4&#8221;\u6807\u8bb0\u4e3a common&#8221;\u7684 Mode \u7684\u540c\u6b65\u673a\u5236\uff09\u3002<\/p>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #7c6cf0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-4\">\u56db\u3001Block \u4e0e GCD<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q12\uff1aBlock \u6709\u54ea\u51e0\u79cd\u7c7b\u578b\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__NSGlobalBlock__<\/code><\/strong>\uff1a\u6ca1\u6709\u6355\u83b7\u4efb\u4f55\u5916\u90e8\u53d8\u91cf\uff0c\u5b58\u5728\u5168\u5c40\u533a\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__NSStackBlock__<\/code><\/strong>\uff1a\u6355\u83b7\u4e86\u5916\u90e8\u53d8\u91cf\uff0c\u5206\u914d\u5728\u6808\u4e0a\uff08MRC \u4e0b\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__NSMallocBlock__<\/code><\/strong>\uff1a\u6808\u4e0a\u7684 Block \u88ab <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">copy<\/code> \u5230\u5806\u4e0a\u3002ARC \u4e0b\u5927\u90e8\u5206\u60c5\u51b5\u4f1a\u81ea\u52a8 copy\u3002<\/li>\n<\/ul>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u8ffd\u95ee&#8221;<strong style=\"color:#0f1c2e;font-weight:600\">\u4e3a\u4ec0\u4e48 Block \u8981\u6355\u83b7\u53d8\u91cf\u7684\u503c\u800c\u4e0d\u662f\u5f15\u7528\uff1f<\/strong>&#8220;\u2014\u2014\u56e0\u4e3a Block \u53ef\u80fd\u5728\u5176\u5b9a\u4e49\u7684\u4f5c\u7528\u57df\u4e4b\u5916\u6267\u884c\uff08\u6bd4\u5982\u5f02\u6b65\u56de\u8c03\uff09\uff0c\u6808\u4e0a\u7684\u5c40\u90e8\u53d8\u91cf\u5c4a\u65f6\u5df2\u7ecf\u5931\u6548\uff0c\u6240\u4ee5<strong style=\"color:#0f1c2e;font-weight:600\">\u666e\u901a\u5c40\u90e8\u53d8\u91cf\u662f\u6309\u503c\u6355\u83b7\uff08const \u62f7\u8d1d\uff09<\/strong>\u3002\u9700\u8981\u4fee\u6539\u5b83\u65f6\uff0c\u5fc5\u987b\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__block<\/code>\uff0c\u7f16\u8bd1\u5668\u4f1a\u628a\u5b83\u5305\u88c5\u6210\u4e00\u4e2a\u7ed3\u6784\u4f53\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u8ba9\u5185\u5916\u5171\u4eab\u540c\u4e00\u4efd\u5b58\u50a8<\/strong>\u3002<\/p>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q13\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__block<\/code> \u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__weak<\/code> \u7684\u533a\u522b\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__block<\/code> \u89e3\u51b3&#8221;\u80fd\u4e0d\u80fd\u6539&#8221;\uff0c<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">__weak<\/code> \u89e3\u51b3&#8221;\u8981\u4e0d\u8981\u6301\u6709&#8221;\uff0c\u4e24\u8005\u7ef4\u5ea6\u4e0d\u540c\uff0c\u7ecf\u5e38\u4e00\u8d77\u7528\u3002<\/strong><\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">__block int counter = 0;          \/\/ \u8ba9 Block \u5185\u90e8\u80fd\u4fee\u6539\u5916\u90e8\u53d8\u91cf\n__weak typeof(self) weakSelf = self;  \/\/ \u8ba9 Block \u4e0d\u5f3a\u6301\u6709 self<\/code><\/pre>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q14\uff1aGCD \u7684\u961f\u5217\u4e0e\u6b7b\u9501\uff1f<\/h3>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u5173\u952e\u533a\u5206\uff1a<strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">dispatch_get_main_queue()<\/code> \u662f\u4e32\u884c\u961f\u5217<\/strong>\u3002\u5728<strong style=\"color:#0f1c2e;font-weight:600\">\u4e3b\u961f\u5217\u91cc\u540c\u6b65\u5411\u4e3b\u961f\u5217\u6d3e\u53d1\u4efb\u52a1<\/strong>\uff0c\u5c31\u4f1a\u6b7b\u9501\u2014\u2014\u56e0\u4e3a\u540c\u6b65\u6d3e\u53d1\u8981\u6c42&#8221;\u7acb\u5373\u6267\u884c&#8221;\uff0c\u800c\u4e3b\u961f\u5217\u6b63\u5728\u6267\u884c\u5f53\u524d\u7684\u540c\u6b65\u6d3e\u53d1\u8bed\u53e5\uff0c\u4efb\u52a1\u6c38\u8fdc\u6392\u4e0d\u5230\u3002<\/p>\n<pre style=\"background:#0f1a2b;color:#dbe6f5;border-radius:12px;padding:18px 20px;overflow-x:auto;font-size:13.6px;line-height:1.78;margin:22px 0;border:1px solid #1e2c42;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace\"><code style=\"background:none;border:none;color:inherit;padding:0;font-size:inherit;font-family:inherit\">\/\/ \u6b7b\u9501\uff1a\u4e3b\u7ebf\u7a0b\u6267\u884c\uff0csync \u5230\u4e3b\u961f\u5217\ndispatch_sync(dispatch_get_main_queue(), ^{\n    NSLog(@\"\u6c38\u8fdc\u4e0d\u4f1a\u6267\u884c\");\n});\n\n\/\/ \u5b89\u5168\uff1a\u5224\u65ad\u5f53\u524d\u662f\u5426\u5df2\u5728\u4e3b\u961f\u5217\nif (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) ==\n    dispatch_queue_get_label(dispatch_get_main_queue())) {\n    block();                                    \/\/ \u76f4\u63a5\u6267\u884c\n} else {\n    dispatch_async(dispatch_get_main_queue(), block);\n}<\/code><\/pre>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #7c6cf0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-5\">\u4e94\u3001SwiftUI\uff1a2026 \u5e74\u7684\u5fc5\u8003\u533a<\/h2>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q15\uff1aSwiftUI \u548c UIKit \u7684\u6839\u672c\u533a\u522b\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u58f0\u660e\u5f0f<\/strong>\uff1a\u63cf\u8ff0&#8221;UI \u5e94\u8be5\u957f\u4ec0\u4e48\u6837&#8221;\uff0c\u800c\u4e0d\u662f&#8221;\u600e\u4e48\u4e00\u6b65\u6b65\u6539\u6210\u90a3\u6837&#8221;\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u503c\u7c7b\u578b\u89c6\u56fe<\/strong>\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">View<\/code> \u662f <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">struct<\/code> \u800c\u975e <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">class<\/code>\uff0c\u8f7b\u91cf\u3001\u65e0\u7ee7\u627f\uff0c\u9760\u7ec4\u5408\u800c\u975e\u7ee7\u627f\u6269\u5c55\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u72b6\u6001\u9a71\u52a8<\/strong>\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code> \u53d8\u5316\u89e6\u53d1 body \u91cd\u65b0\u6c42\u503c\uff0c\u6846\u67b6 diff \u51fa\u771f\u5b9e\u53d8\u66f4\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u4e0e UIKit \u53ef\u4e92\u64cd\u4f5c<\/strong>\uff1a\u901a\u8fc7 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">UIViewRepresentable<\/code> \/ <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">UIViewControllerRepresentable<\/code> \u53cc\u5411\u6865\u63a5\uff0c\u8001\u9879\u76ee\u53ef\u4ee5\u6e10\u8fdb\u8fc1\u79fb\u3002<\/li>\n<\/ul>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q16\uff1a<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Binding<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObservedObject<\/code>\u3001<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@EnvironmentObject<\/code> \u600e\u4e48\u9009\uff1f<\/h3>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;border:1px solid #e3eaf3;border-radius:10px;overflow:hidden\">\n<thead>\n<tr>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u5c5e\u6027\u5305\u88c5\u5668<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u6240\u6709\u6743<\/th>\n<th style=\"background:#f2f6fb;color:#12233a;font-weight:700;padding:12px 14px;text-align:left;border-bottom:1px solid #e3eaf3;font-size:15px\">\u9002\u7528\u573a\u666f<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@State<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u62e5\u6709<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u89c6\u56fe\u79c1\u6709\u7684\u7b80\u5355\u503c\uff08\u5f00\u5173\u3001\u8f93\u5165\u6587\u672c\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Binding<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u501f\u7528<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u5b50\u89c6\u56fe\u8bfb\u5199\u7236\u89c6\u56fe\u7684\u72b6\u6001\uff0c\u53cc\u5411\u4f20\u9012<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObservedObject<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u5916\u90e8\u6301\u6709<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u5f15\u7528\u7c7b\u578b\u7684\u5916\u90e8\u6a21\u578b\uff0c\u9700\u81ea\u5df1\u4fdd\u8bc1\u751f\u547d\u5468\u671f<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@StateObject<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><strong style=\"color:#0f1c2e;font-weight:600\">\u62e5\u6709<\/strong><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u89c6\u56fe\u9996\u6b21\u521b\u5efa\u65f6\u521d\u59cb\u5316\u7684\u6a21\u578b\uff0c<strong style=\"color:#0f1c2e;font-weight:600\">\u751f\u547d\u5468\u671f\u4e0e\u89c6\u56fe\u7ed1\u5b9a<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@EnvironmentObject<\/code><\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u73af\u5883\u6ce8\u5165<\/td>\n<td style=\"padding:12px 14px;border-bottom:1px solid #eff4fa;color:#3a4a63;line-height:1.75\">\u8de8\u591a\u5c42\u89c6\u56fe\u5171\u4eab\uff0c\u907f\u514d\u9010\u5c42\u4f20\u9012<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin:24px 0;padding:16px 22px;background:#f7fafd;border-left:4px solid #7c6cf0;border-radius:0 10px 10px 0;color:#4a5b73;font-size:15.6px;line-height:1.88\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u9ad8\u9891\u9677\u9631\uff1a&#8221;<strong style=\"color:#0f1c2e;font-weight:600\"><code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObservedObject<\/code> \u548c <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@StateObject<\/code> \u7684\u533a\u522b\uff1f<\/strong>&#8220;\u2014\u2014<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@ObservedObject<\/code> <strong style=\"color:#0f1c2e;font-weight:600\">\u4e0d\u6301\u6709<\/strong>\u5bf9\u8c61\uff0c\u89c6\u56fe\u91cd\u5efa\u65f6\u53ef\u80fd\u88ab\u610f\u5916\u91cd\u7f6e\uff08\u6bd4\u5982\u5728\u7236\u89c6\u56fe body \u91cc <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">ViewModel()<\/code> \u73b0\u573a\u521b\u5efa\uff09\uff1b<code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@StateObject<\/code> \u53ea\u5728\u89c6\u56fe<strong style=\"color:#0f1c2e;font-weight:600\">\u9996\u6b21\u521b\u5efa<\/strong>\u65f6\u521d\u59cb\u5316\u4e00\u6b21\uff0c\u91cd\u5efa\u65f6\u4fdd\u6301\u3002<strong style=\"color:#0f1c2e;font-weight:600\">\u5728\u89c6\u56fe\u5185\u90e8\u521b\u5efa\u7684\u6a21\u578b\u5fc5\u987b\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@StateObject<\/code>\u3002<\/strong><\/p>\n<\/blockquote>\n<h3 style=\"font-size:18.5px;line-height:1.55;font-weight:700;color:#18283e;margin:30px 0 12px;padding-left:12px;border-left:3px solid #7c6cf040\">Q17\uff1aSwiftUI \u7684 body \u4f1a\u88ab\u9891\u7e41\u6c42\u503c\uff0c\u600e\u4e48\u4f18\u5316\uff1f<\/h3>\n<ul style=\"padding-left:26px;margin:16px 0\">\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u62c6\u5206\u89c6\u56fe<\/strong>\uff1a\u628a\u5927 body \u62c6\u6210\u5c0f\u7ec4\u4ef6\uff0c\u8ba9\u72b6\u6001\u53d8\u5316\u53ea\u5f71\u54cd\u771f\u6b63\u4f9d\u8d56\u5b83\u7684\u5b50\u6811\uff08<strong style=\"color:#0f1c2e;font-weight:600\">\u7f29\u5c0f\u5931\u6548\u8303\u56f4<\/strong>\uff09\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u51cf\u5c11\u4f9d\u8d56<\/strong>\uff1a\u89c6\u56fe\u53ea\u58f0\u660e\u5b83\u771f\u6b63\u7528\u5230\u7684\u72b6\u6001\uff0c\u591a\u4f59\u7684\u4f9d\u8d56\u4f1a\u5bfc\u81f4\u65e0\u8c13\u91cd\u7b97\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u7ed9\u6a21\u578b\u52a0\u7c92\u5ea6<\/strong>\uff1a\u4f7f\u7528 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">@Observable<\/code>\uff08Observation \u6846\u67b6\uff09\u540e\uff0c\u53ea\u6709<strong style=\"color:#0f1c2e;font-weight:600\">\u771f\u6b63\u88ab\u8bfb\u53d6\u7684\u5c5e\u6027<\/strong>\u624d\u4f1a\u5efa\u7acb\u4f9d\u8d56\uff0c\u6bd4 <code style=\"background:#eef4fb;color:#0b6bcb;padding:2px 7px;border-radius:5px;font-size:14px;font-family:\"JetBrains Mono\",Consolas,Monaco,\"Courier New\",monospace;border:1px solid #dce8f6;white-space:nowrap\">ObservableObject<\/code> \u7684&#8221;\u6574\u4f53\u53d1\u5e03&#8221;\u66f4\u7cbe\u51c6\u3002<\/li>\n<li style=\"font-size:16.2px;line-height:1.92;color:#35435c;margin:10px 0;letter-spacing:.2px\"><strong style=\"color:#0f1c2e;font-weight:600\">\u8017\u65f6\u8ba1\u7b97\u5916\u79fb<\/strong>\uff1abody \u5e94\u5f53\u662f\u7eaf\u51fd\u6570\u4e14\u5f00\u9500\u6781\u5c0f\uff0c\u91cd\u6d3b\u653e\u8fdb model \u6216\u5f02\u6b65\u4efb\u52a1\u3002<\/li>\n<\/ul>\n<h2 style=\"font-size:23px;line-height:1.45;font-weight:700;color:#0f1c2e;margin:46px 0 18px;padding:0 0 12px 14px;border-left:5px solid #7c6cf0;border-bottom:1px solid #eef2f7;letter-spacing:.3px\" id=\"sec-6\">\u516d\u3001\u5c0f\u7ed3<\/h2>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">iOS \u539f\u7406\u9898\u7684\u6838\u5fc3\u4e3b\u7ebf\u662f<strong style=\"color:#0f1c2e;font-weight:600\">&#8220;\u52a8\u6001\u6027 + \u5185\u5b58\u6a21\u578b + \u4e8b\u4ef6\u5faa\u73af&#8221;<\/strong>\uff1aRuntime \u652f\u6491\u4e86 OC \u7684\u4e00\u5207\u52a8\u6001\u80fd\u529b\uff0cARC \u4e0e weak \u8868\u89e3\u51b3\u7684\u662f\u5f15\u7528\u8ba1\u6570\u81ea\u52a8\u5316\u7684\u8fb9\u754c\u95ee\u9898\uff0cRunLoop \u662f\u4e3b\u7ebf\u7a0b\u54cd\u5e94\u7528\u6237\u4e0e\u7cfb\u7edf\u4e8b\u4ef6\u7684\u5fc3\u8df3\uff0cSwiftUI \u5219\u4ee3\u8868\u7740\u4ece\u547d\u4ee4\u5f0f\u5230\u58f0\u660e\u5f0f\u7684\u8303\u5f0f\u8f6c\u79fb\u3002<\/p>\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\">\u51c6\u5907\u5efa\u8bae\uff1a<strong style=\"color:#0f1c2e;font-weight:600\">\u6bcf\u6761\u4e3b\u7ebf\u914d\u4e00\u4e2a\u771f\u5b9e\u6848\u4f8b<\/strong>\u2014\u2014&#8221;Block \u5faa\u73af\u5f15\u7528\u5bfc\u81f4\u9875\u9762\u4e0d\u91ca\u653e\uff0c\u7528 weak-strong dance \u89e3\u51b3&#8221;&#8221;\u6eda\u52a8\u65f6 Timer \u4e0d\u89e6\u53d1\uff0c\u6539\u5230 CommonModes \u624d\u6b63\u5e38&#8221;\u3002\u5177\u4f53\u7ecf\u5386\u6bd4\u5b8c\u6574\u80cc\u8bf5\u6e90\u7801\u66f4\u80fd\u8bf4\u660e\u4f60\u771f\u7684\u505a\u8fc7\u3002<\/p>\n<hr style=\"border:none;border-top:1px solid #eaeef4;margin:34px 0\">\n<p style=\"font-size:16.2px;line-height:1.95;color:#35435c;margin:16px 0;letter-spacing:.2px\"><em style=\"color:#5a6b85;font-style:normal;background:#7c6cf01f;padding:1px 4px;border-radius:4px\">\u53c2\u8003\uff1a<a href=\"https:\/\/developer.apple.com\/documentation\/\" target=\"_blank\" rel=\"noopener\" style=\"color:#7c6cf0;text-decoration:none;border-bottom:1px solid #7c6cf066;transition:opacity .15s\">Apple \u5f00\u53d1\u8005\u6587\u6863<\/a>\u3001<a href=\"https:\/\/developer.apple.com\/documentation\/swiftui\" target=\"_blank\" rel=\"noopener\" style=\"color:#7c6cf0;text-decoration:none;border-bottom:1px solid #7c6cf066;transition:opacity .15s\">SwiftUI \u6587\u6863<\/a>\u3001<a href=\"https:\/\/github.com\/apple\/swift-corelibs-foundation\" target=\"_blank\" rel=\"noopener\" style=\"color:#7c6cf0;text-decoration:none;border-bottom:1px solid #7c6cf066;transition:opacity .15s\">swift-corelibs-foundation<\/a>\u3002API \u884c\u4e3a\u968f\u7cfb\u7edf\u7248\u672c\u6f14\u8fdb\uff0c\u6d89\u53ca\u751f\u547d\u5468\u671f\u4e0e\u540e\u53f0\u884c\u4e3a\u7684\u8bf7\u4ee5\u76ee\u6807\u7248\u672c\u7684\u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u3002<\/em><\/p>\n<div style=\"margin:42px 0 0;padding:22px 0 0;border-top:1px solid #eaeef4\">\n<div style=\"font-size:13px;color:#93a1b5;letter-spacing:1px;margin-bottom:12px\">\u6807\u7b7e<\/div>\n<p><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#iOS \u9762\u8bd5\u9898<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#Runtime<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#RunLoop<\/span><span style=\"display:inline-block;background:#f3f6fa;border:1px solid #e4eaf2;color:#5b6c85;font-size:13px;padding:5px 12px;border-radius:999px;margin:0 8px 8px 0\">#\u9762\u8bd5<\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>iOS \u9762\u8bd5\u7684\u539f\u7406\u9898\u6709\u51e0\u4e2a\u7ecf\u5178\u5f97\u4e0d\u80fd\u518d\u7ecf\u5178\u7684\u8003\u70b9\u3002\u672c\u6587\u9010\u9898\u7ed9\u51fa\u6807\u51c6\u7b54\u6cd5\u4e0e\u8ffd\u95ee\u9677\u9631\uff1a\u6d88\u606f\u53d1\u9001\u4e0e\u8f6c\u53d1\u4e09\u9636\u6bb5\u3001weak \u81ea\u52a8\u7f6e nil \u7684 SideTable \u5b9e\u73b0\u3001Block \u5faa\u73af\u5f15\u7528\u3001RunLoop \u7684 Mode \u673a\u5236\uff0c\u4ee5\u53ca SwiftUI \u7684\u4e94\u4e2a\u5c5e\u6027\u5305\u88c5\u5668\u600e\u4e48\u9009\u3002<\/p>\n","protected":false},"author":1,"featured_media":245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,11],"tags":[121,123,122,66],"class_list":["post-247","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobile-question-bank","category-question-bank","tag-ios-","tag-runloop","tag-runtime","tag-66"],"_links":{"self":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":0,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media\/245"}],"wp:attachment":[{"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ziliaochi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}