Why does Apple allow .NET on the iPhone but not Flash?
From what I understand, Apple has banned the Flash runtime on the iPhone because Apple doesn't want an alternative runtime environment to that which Apple provides via their own tools. Allowing a Flash runtime, according to Apple, would allow developers to circumvent application update policies and other controls 开发者_如何学编程which Apple has put in place. And at this time, Adobe has not chosen to build tools to statically compile apps created in Flash.
My further understanding is that .NET apps created via MonoTouch are statically precompiled and hit the iPhone as native code vs. running inside the .NET common language runtime (CLR), which Apple would surely disallow. Since .NET code is not executing in Microsoft's runtime but rather natively on the iPhone CPU, Apple isn't complaining.
My questions are:
Am I correct about why Apple allows .NET-developed applications on the iPhone?
Is one vendor's precompiled, native code on the iPhone (or any platform I suppose) distinguishable from any other? In other words, is native code that's produced by MonoTouch indistinguishable from native code produced by compiled Objective C code? Is the source of the native code totally opaque?
As you just said, Apple is not "allowing" .NET to run on the iPhone - whether an application was developed in MonoTouch or written in Cocoa or COBOL or whatever doesn't matter; it only matters what it is compiled to. It could be written in JavaScript and it wouldn't matter.
If I write something in English and then translate it to French, can a French reader tell the original version was written in English? Maybe, probably not, and it's all up to the characteristics of the translation, not the reader. All Apple requires is the version you give them is written in French. Up to that point it makes no difference.
A logical extension of this is that you could, in theory, write a compiler for Flash files that creates self-contained iPhone binaries. If developing in Flash is what's important to you. (This may or may not have already been done This has already been done.)
All MonoTouch does is it transliterates the Mono code into objective C and compiles it to native code, so once it's compiled that can 'run' despite the usage of Mono. It's really a wrapper for the mono code which gets translated to the equivalent of the objective C native code and runtime libraries.
They are not really .NET runtime code per se. So there is no real distinguishable difference at all! Once it's compiled to native code that's it.
Apple doesn't care about VM's running on the iPhone. It cares about allowing external, non-appstore code to be run on the iPhone.
That's why Apple won't care about Adobe's proposed "Flash Compiler" that makes standalone Flash apps. That's why Apple doesn't care about compiled .NET projects.
Recall the issue with the C64 emulator. Apple only cared that it bundled the internal BASIC, yet an emulator is a perfect example of a VM. All of the C64 code being executed by that VM is 6502 Machine code. But the emulator lacks the ability to download arbitrary code from the network and execute it.
That's what Apple is concerned with.
1 - You're pretty much correct. I wouldn't say that Apple "allows" MonoTouch apps on the platform, they just haven't said anything publicly either way, and there are some MonoTouch apps already in the app store. Doesn't mean that they won't start blocking them all tomorrow.
2 - I don't know much about the internals of Mono Touch but I would imagine that there must be some common traits that MT apps have (the way it inflates the binary size, there's gotta be some commonality in there somewhere) that Apple can use to single them out. Of course, that might take an incredibly significant effort for little benefit, and they probably would rather spend their time in getting 3.2 and beyond out the door.
I think you're kinda confused about the differences between tools used to develop native apps and what kind of browser plugins Apple wants to support in Safari. Completely different concepts. I think you should read John Gruber's recent piece for a pretty comprehensive theory on why Flash will probably never be on the iPhone or iPad.
It seems that soon you will be able to make native iPhone applications directly from flash.
http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/
It will be interesting to know the performance of these apps, but for the General Media/Marketing/Business sectors, I think this is exactly how a lot of apps will go.
Have a look here ,apple
It is Adobe, not Apple who develops Flash for the various OS/devices. Adobe has been unable to develop a satisfactory Flash for iOS devices.
http://www.apple.com/hotnews/thoughts-on-flash/
精彩评论