{"rsdb":{"rid":"406713","subhead":"","postdate":"0","aid":"281206","fid":"99","uid":"1","topic":"1","content":"
\n

\u5982\u679c\u4f60\u89c9\u5f97 UITableViewDelegate<\/code> \u548c UITableViewDataSource<\/code> \u8fd9\u4e24\u4e2a\u534f\u8bae\u4e2d\u6709\u5927\u91cf\u65b9\u6cd5\u6bcf\u6b21\u90fd\u662f\u590d\u5236\u7c98\u8d34\uff0c\u5b9e\u73b0\u8d77\u6765\u5927\u540c\u5c0f\u5f02\uff1b\u5982\u679c\u4f60\u89c9\u5f97\u53d1\u8d77\u7f51\u7edc\u8bf7\u6c42\u5e76\u89e3\u6790\u6570\u636e\u9700\u8981\u4e00\u5927\u6bb5\u4ee3\u7801\uff0c\u52a0\u4e0a\u5237\u65b0\u548c\u52a0\u8f7d\u540e\u7b80\u76f4\u590d\u6742\u5ea6\u7206\u8868\uff0c\u5982\u679c\u4f60\u60f3\u77e5\u9053\u4e3a\u4ec0\u4e48\u4e0b\u9762\u7684\u4ee3\u7801\u53ef\u4ee5\u6ee1\u8db3\u4e0a\u8ff0\u6240\u6709\u8981\u6c42\uff1a<\/p> \n

\n
\n
\n  \n <\/div> \n
\n \"\"\n <\/div> \n <\/div> \n
\n \u89e3\u8026\u540e\u7684VC\n <\/div> \n <\/div> \n

\u7cfb\u597d\u5b89\u5168\u5e26\uff0c\u4e0a\u8f66\uff01<\/p> \n

MVC<\/h1> \n

\u5728\u8ba8\u8bba\u89e3\u8026\u4e4b\u524d\uff0c\u6211\u4eec\u8981\u5f04\u660e\u767d MVC \u7684\u6838\u5fc3\uff1a\u63a7\u5236\u5668\uff08\u4ee5\u4e0b\u7b80\u79f0 C\uff09\u8d1f\u8d23\u6a21\u578b\uff08\u4ee5\u4e0b\u7b80\u79f0 M\uff09\u548c\u89c6\u56fe\uff08\u4ee5\u4e0b\u7b80\u79f0 V\uff09\u7684\u4ea4\u4e92\u3002<\/p> \n

\u8fd9\u91cc\u6240\u8bf4\u7684 M\uff0c\u901a\u5e38\u4e0d\u662f\u4e00\u4e2a\u5355\u72ec\u7684\u7c7b\uff0c\u5f88\u591a\u60c5\u51b5\u4e0b\u5b83\u662f\u7531\u591a\u4e2a\u7c7b\u6784\u6210\u7684\u4e00\u4e2a\u5c42\u3002\u6700\u4e0a\u5c42\u7684\u901a\u5e38\u662f\u4ee5 Model<\/code> \u7ed3\u5c3e\u7684\u7c7b\uff0c\u5b83\u76f4\u63a5\u88ab C \u6301\u6709\u3002Model<\/code> \u7c7b\u8fd8\u53ef\u4ee5\u6301\u6709\u4e24\u4e2a\u5bf9\u8c61\uff1a<\/p> \n

    \n
  1. Item\uff1a\u5b83\u662f\u5b9e\u9645\u5b58\u50a8\u6570\u636e\u7684\u5bf9\u8c61\u3002\u5b83\u53ef\u4ee5\u7406\u89e3\u4e3a\u4e00\u4e2a\u5b57\u5178\uff0c\u548c V \u4e2d\u7684\u5c5e\u6027\u4e00\u4e00\u5bf9\u5e94<\/li> \n
  2. Cache\uff1a\u5b83\u53ef\u4ee5\u7f13\u5b58\u81ea\u5df1\u7684 Item\uff08\u5982\u679c\u6709\u5f88\u591a\uff09<\/li> \n <\/ol> \n

    \u5e38\u89c1\u7684\u8bef\u533a\uff1a<\/p> \n

      \n
    1. \u4e00\u822c\u60c5\u51b5\u4e0b\u6570\u636e\u7684\u5904\u7406\u4f1a\u653e\u5728 M \u800c\u4e0d\u662f C\uff08C \u53ea\u505a\u4e0d\u80fd\u590d\u7528\u7684\u4e8b\uff09<\/li> \n
    2. \u89e3\u8026\u4e0d\u53ea\u662f\u628a\u4e00\u6bb5\u4ee3\u7801\u62ff\u5230\u5916\u9762\u53bb\u3002\u800c\u662f\u5173\u6ce8\u662f\u5426\u80fd\u5408\u5e76\u91cd\u590d\u4ee3\u7801\uff0c \u5e76\u4e14\u6709\u826f\u597d\u7684\u62d6\u5c55\u6027\u3002<\/li> \n <\/ol> \n

      \u539f\u59cb\u7248<\/h1> \n

      \u5728 C \u4e2d\uff0c\u6211\u4eec\u521b\u5efa UITableView<\/code> \u5bf9\u8c61\uff0c\u7136\u540e\u5c06\u5b83\u7684\u6570\u636e\u6e90\u548c\u4ee3\u7406\u8bbe\u7f6e\u4e3a\u81ea\u5df1\u3002\u4e5f\u5c31\u662f\u81ea\u5df1\u7ba1\u7406\u7740 UI \u903b\u8f91\u548c\u6570\u636e\u5b58\u53d6\u7684\u903b\u8f91\u3002\u5728\u8fd9\u79cd\u67b6\u6784\u4e0b\uff0c\u4e3b\u8981\u5b58\u5728\u8fd9\u4e9b\u95ee\u9898\uff1a<\/p> \n

        \n
      1. \u8fdd\u80cc MVC \u6a21\u5f0f\uff0c\u73b0\u5728\u662f V \u6301\u6709 C \u548c M\u3002<\/li> \n
      2. C \u7ba1\u7406\u4e86\u5168\u90e8\u903b\u8f91\uff0c\u8026\u5408\u592a\u4e25\u91cd\u3002<\/li> \n
      3. \u5176\u5b9e\u7edd\u5927\u591a\u6570 UI \u76f8\u5173\u90fd\u662f\u7531 Cell \u800c\u4e0d\u662f UITableView<\/code> \u81ea\u8eab\u5b8c\u6210\u7684\u3002<\/li> \n <\/ol> \n

        \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u9996\u5148\u5f04\u660e\u767d\uff0c\u6570\u636e\u6e90\u548c\u4ee3\u7406\u5206\u522b\u505a\u4e86\u90a3\u4e9b\u4e8b\u3002<\/p> \n

        \u6570\u636e\u6e90<\/h3> \n

        \u5b83\u6709\u4e24\u4e2a\u5fc5\u987b\u5b9e\u73b0\u7684\u4ee3\u7406\u65b9\u6cd5\uff1a<\/p> \n

        \n