📜 ⬆️ ⬇️

Mono, MonoTouch + C # vs. iPhone SDK + Objective-C

It so happened that my work as a software developer is related to both the iPhone and. NET technologies. If we say that it is primary, then this is, of course, .NET and C #, so the information will be provided from the point of view of the dotnetchik.

In the article I want to talk about a little experience in developing one project at the same time on mono using MonoTouch and in native Objective-C.

Project Description


It was necessary to develop a beautiful page turning effect for a single iPhone application. A good example of what needed to be done was found on the Internet in the form of a Silverlight application.

Option number 1: Mono + MonoTouch


I think it is not necessary to say what Mono is .
')
MonoTouch allows you to write C # applications and compile them for iPhone, as well as use .NET libraries.

Full software suite:
* Apple Mac OS X
* Installed Mono for Mac OS X
* MonoDevelop
* MonoTouch

First of all, the source code on Silverlight was compiled without any problems under MacOS and launched in Safari (Silverlight on Macos is already Moonlight ). It was a good sign.

The MonoTouch project was created and, using the cross-platform copy-paste technology, 80% of the application was written. Adaptation of the rest of the code took about two days, after which the first version of the application was demonstrated. I want to note that the application worked quickly (it consisted mainly of mathematical calculations that were used for image transformations).

Unfortunately, the customer did not accept the option on MonoTouch, it was necessary to have an application written in native Objective-C.

Option number 2: iPhone SDK + Objective-C


The code from C # to Objective-C was rewritten during the day and ... after that, the application began to slow down terribly. Another two days were spent fighting memory leaks and writing release for some local variables, after which the applications started to work identically.

Here, you need to stop and make a lyrical digression. I understand perfectly well that a good developer should understand how memory allocation works, how to find memory leaks and how to avoid them. So, why I love .NET and C #, that I do not need to be distracted by how to implement something, but I can concentrate on what I need to implement.

findings


Thus, I made the following conclusions in this situation:
* no addictions and additional manuals are needed (as is the case with Xcode) in order to start working with the tools listed above;
* if you are a touch maker and you have the opportunity to write on C # and MonoTouch - do better and save you from many problems;
* mono - not so final * ny platform, as someone wants to think;
* despite the fact that MonoTouch is a young product, there are already a lot of materials in the network related to the use of this product;
* in fact, you use the iPhone SDK, but use C # syntax and .NET capabilities (for example, string1 + string2 instead of [string1 stringByAppendingString: string2]);
* Convenience in MonoDevelop is much higher than in Xcode.

I hope this little experience will help you navigate the future when choosing tools for developing iPhone applications (in case you are a smart phone).

PS As a result, OpenGL ES was chosen for implementation, since the effect on the device was terribly slow.

Source: https://habr.com/ru/post/85439/


All Articles