Cocoa versus Cocoa Touch - What is the difference?

前端 未结 6 827
逝去的感伤
逝去的感伤 2020-12-23 19:42

I am learning iOS development in Objective-C, and I have found a lot of code examples.

Some of them, though, say that they are only for Mac OS X (not iOS).

C

6条回答
  •  梦毁少年i
    2020-12-23 19:59

    Application Framework For
    i) Cocoa is the application framework for Mac OS X.
    ii) Cocoa Touch is the application framework for iPhone and iPod Touch.

    Frameworks
    i) Cocoa: Foundation and AppKit.
    ii) Cocoa Touch: Foundation and UIKit

    Absence of certain classes
    Cocoa has NSHost and Cocoa Touch doesn't

    API
    i) Cocoa: All the classes used in Cocoa have the NS prefix Ex: NSTextField
    ii) Cocoa Touch: classes used in Cocoa have the UI prefix Ex: UITextField

    MVC patterns
    i) Cocoa: Cocoa has multiple alternative design patterns – in addition to MVC
    ii) Cocoa Touch: The iPhone SDK has a reinforced MVC system, which performs better than the default MVC in Cocoa

    Other Differences
    There Are also Differences In App Lifecycle, Sandboxing ,Memory Footprint

    Links:
    http://teks.co.in/site/blog/cocoa-vs-cocoa-touch-beginners-guide/ http://iphonenativeapp.blogspot.in/2011/02/difference-between-cocoacocoa-touch-and.html https://iphonecodecenter.wordpress.com/tag/difference-between-cocoa-cocoa-touch/

提交回复
热议问题