Navigation

    云、贵、川、渝IT人的圈子
    • Register
    • Login
    • Search
    • 主页
    • 问答
    • 话题
    • 热门
    • 圈子
    • 招聘
    • 活动
    • 项目

    Cocoa和CocoaTouch的模型框架Mantle

    开源推荐
    mantle
    1
    1
    60
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      caimiu49 last edited by

      Mantle 是 Cocoa 和 Cocoa Touch 的模型框架,你可以通过它为你的 Cocoa 和 Cocoa Touch 写简单的模型层。

      Managed Object Model 是描写叙述应用程序的数据模型,这个模型包括实体(Entity)。特性(Property),读取请求(Fetch Request)等。(下文都使用英文术语。)

      Managed Object Context 参与对数据对象进行各种操作的全过程,并监測数据对象的变化,以提供对 undo/redo 的支持及更新绑定到数据的 UI。

      Persistent Store Coordinator 相当于数据文件管理器,处理底层的对数据文件的读取与写入。一般我们无需与它打交道。

      Managed Object 数据对象,与 Managed Object Context 相关联。

      图中绿色的 Array Controller, Object Controller, Tree Controller 这些控制器。一般都是通过 control+drag 将 Managed Object Context 绑定到它们。这样我们就能够在 nib 中可视化地操作数据。

      Mantle可以轻松把JSON数据、字典(Dictionary)和模型(即Objective对象)之间的相互转换,支持自定义映射,并且内置实现了NSCoding和NSCoping,大大简化归档操作。

      项目地址: https://github.com/Mantle/Mantle

      替代文字

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      C
      8
      玻
      U
      A
      大
      A
      黑
      低
      天
      白
      快
      爱
      白
      美
      此
      荒
      为
      哭
      柳
      无
      真

      社群
      昆明网页设计交流吧
      友情链接
      • Funtask
      • Funtask 社区
      • SUWIS
      • 云南北大青鸟
      ©2019-2020 滇ICP备20006698号