.net程序员的iPhone开发-MonoTouch

简介: iPhone软件的Native开发除了使用Apple推荐的Objective-C  Cocoa之外,也有其他的一些工具和SDK提供 基于WEB的形式的一些框架在下面这个文章介绍过 各种SmartPhone上的跨平台开源框架的总结 http://www.

iPhone软件的Native开发除了使用Apple推荐的Objective-C  Cocoa之外,也有其他的一些工具和SDK提供

基于WEB的形式的一些框架在下面这个文章介绍过

各种SmartPhone上的跨平台开源框架的总结

http://www.cnblogs.com/2018/archive/2010/12/28/1918814.html

 

对于.net人员来说,使用C#语言也可以进行开发,这就是MonoTouch

monotouch

2009年Novell开始的项目

通过MonoTouch,使用C#语言实现可以在iPhone上发布和销售的软件

MonoTouch免费版本只能在模拟器中开发调试和测试,在iPhone设备和app store上必须购买授权。http://monotouch.net/DownloadTrial

开发环境准备

 1. Make sure you have your Intel Mac running at least version 10.5.7

  2. Download and install the Mono framework: www.go-mono.com/mono-downloads/download.html.

  3. Download and install MonoTouch: http://monotouch.net/

  4. Download and install MonoDevelop: http://monodevelop.com/Download

  5. Download and install the iPhone SDK: www.apple.com/downloads/macosx/development_tools/iphonesdk.html.

安装好以上的工具后就可以使用MonoDevelop进行开发了

MonoTouch 组件和类库

MonoTouch is made up of the following four components:

  • The  Monotouch.dll is a C# assembly that provides a binding API into the iPhone’s native APIs.
  • A command-line tool that compiles C# and Common Intermediate Language (CIL) code. This compiled code can then be run in the simulator or an actual iPhone.
  • An add-in to MonoDevelop that allows for iPhone development and for Interface Builder to create graphical applications.
  • A commercial license of the Mono runtime, which allows for the static linking of the Mono runtime with the code developed.

最常用的命名空间

  • MonoTouch.ObjCRuntime: This namespace provides the interop/bridge between the .NET/C# world and the Objective-C world of the iPhone.
  • MonoTouch.Foundation: This namespace provides support for the data types necessary to communicate with the Objective-C world of the iPhone. Most types are directly mapped. For example, the NSObject Objective-C base class is mapped to the MonoTouch.Foundation .NSObject class in C#. Some classes are not directly mapped and are instead mapped to their native .NET types. For example, NSString maps to the basic string type and NSArray maps to a strongly typed array.
  • MonoTouch.UIKit: This namespace provides a direct mapping between the UI components within Cocoa Touch. The mapping is done by providing .NET classes for each UI component, and this is the namespace that developers will likely spend most of their time working with. For .NET developers, Cocoa Touch is an abstraction layer or API for building programs that run in the iPhone. Cocoa Touch is based on the Cocoa API used in building programs that run on the Mac OS X operating system. Cocoa Touch can be thought of as Cocoa tuned for the touch-based iPhone operating system.
  • OpenTK: This namespace is a modified version of the OpenTK API. OpenTK is an objectoriented binding for OpenGL, which stands for the Open Graphics Library. OpenGL is an API for using three-dimensional graphics. OpenTK is a library for performing OpenGL, OpenAL, and OpenCL. It is written in C# and runs on Windows, Mac OS X, and Linux. The OpenTK implementation on the iPhone has been updated to use CoreGraphics and to only expose the functionality available on the iPhone.

 

相关文章
|
1月前
|
人工智能 前端开发 Devops
.NET技术在现代开发中的作用:.NET技术的核心价值、在现代应用开发中的实际应用、以及面临的挑战与未来趋势。
.NET技术是软件开发领域的核心力量,本文从其核心价值、实际应用及未来挑战三方面进行探讨。它支持多种语言,提供强大的开发工具和丰富的类库,并具备跨平台能力。在现代应用开发中,.NET广泛应用于企业级系统、Web应用、移动应用、云服务和游戏开发等领域。面对性能优化、容器化、AI集成等挑战,.NET持续创新以适应不断发展变化的技术环境。
48 4
|
1月前
|
人工智能 开发框架 .NET
.NET技术的强大功能:.NET技术的基础特性、在现代开发中的应用、以及它如何助力未来的软件开发。
.NET技术是软件开发领域的核心支柱,以其强大功能、灵活性及安全性广受认可。本文分三部分解析:基础特性如多语言支持、统一运行时环境;现代应用如企业级与Web开发、移动应用、云服务及游戏开发;以及未来趋势如性能优化、容器化、AI集成等,展望.NET在不断变化的技术环境中持续发展与创新。
65 4
|
1月前
|
人工智能 开发框架 .NET
如何掌握.NET技术,引领开发前沿:.NET技术的核心能力、在现代开发中的应用实践、以及如何通过.NET技术实现持续创新。
.NET技术已成为软件开发不可或缺的部分,本文分三部分探讨:核心能力如多语言支持、统一运行时环境、丰富的类库及跨平台能力;现代开发实践包括企业级应用、Web与移动开发、云服务及游戏开发;并通过性能优化、容器化、AI集成等方面实现持续创新,使开发者站在技术前沿。
47 3
|
2天前
|
人工智能 前端开发 开发工具
解读.NET 技术的开发潜力
本文全面介绍了.NET技术在软件开发领域的核心优势、创新应用及面临的挑战。.NET以其统一的开发平台、强大的工具和跨平台能力,成为企业级应用、Web应用乃至游戏开发的理想选择。然而,在性能优化、容器化及AI集成等方面仍需不断突破。通过积极拥抱开源和社区驱动模式,.NET将持续推动软件开发的进步。
11 1
|
14天前
|
存储 运维
.NET开发必备技巧:使用Visual Studio分析.NET Dump,快速查找程序内存泄漏问题!
.NET开发必备技巧:使用Visual Studio分析.NET Dump,快速查找程序内存泄漏问题!
|
14天前
|
SQL 关系型数据库 数据库
七天.NET 8操作SQLite入门到实战详细教程(选型、开发、发布、部署)
七天.NET 8操作SQLite入门到实战详细教程(选型、开发、发布、部署)
|
14天前
|
消息中间件 开发框架 前端开发
YuebonCore:基于.NET8开源、免费的权限管理及快速开发框架
YuebonCore:基于.NET8开源、免费的权限管理及快速开发框架
|
19天前
|
开发框架 JavaScript 前端开发
|
24天前
|
JSON C# 开发者
💡探索C#语言进化论:揭秘.NET开发效率飙升的秘密武器💼
【8月更文挑战第28天】C#语言凭借其强大的功能与易用性深受开发者喜爱。伴随.NET平台演进,C#持续引入新特性,如C# 7.0的模式匹配,让处理复杂数据结构更直观简洁;C# 8.0的异步流则使异步编程更灵活高效,无需一次性加载全部数据至内存。通过示例展示了模式匹配简化JSON解析及异步流实现文件逐行读取的应用。此外,C# 8.0还提供了默认接口成员和可空引用类型等特性,进一步提高.NET开发效率与代码可维护性。随着C#的发展,未来的.NET开发将更加高效便捷。
39 1
|
20天前
|
C# Windows 开发者
超越选择焦虑:深入解析WinForms、WPF与UWP——谁才是打造顶级.NET桌面应用的终极利器?从开发效率到视觉享受,全面解读三大框架优劣,助你精准匹配项目需求,构建完美桌面应用生态系统
【8月更文挑战第31天】.NET框架为开发者提供了多种桌面应用开发选项,包括WinForms、WPF和UWP。WinForms简单易用,适合快速开发基本应用;WPF提供强大的UI设计工具和丰富的视觉体验,支持XAML,易于实现复杂布局;UWP专为Windows 10设计,支持多设备,充分利用现代硬件特性。本文通过示例代码详细介绍这三种框架的特点,帮助读者根据项目需求做出明智选择。以下是各框架的简单示例代码,便于理解其基本用法。
59 0