i was experiencing a 100% crashing crosscompiler and thought it was because of the guiskin, as this was one of the last things i did, but by stripping down part for part i found what was causing the crash.
it is the use of regex from javascript - and maybe other languages
this is the first time i used .net stuff from javascript, so it may be my fault. is there anything wrong with:
import System.Text.RegularExpressions;
function IsEmail(accountEmail : String) {
var re=new Regex("[^@]+[@][^@]+\\.[^@]+");
var m=re.Match(accountEmail);
return m.Success;
}
Sure that Regex is .NEt 1.1?
because iphone is not .NET 2.0 as the regular unity.
beside that your code is not strict typed, the iphone will not accept non-strict type js. Thought that won’t crash it, just throw two errors for your “var …” lines.
to get that mentioned directly, just add #pragma strict to all your js scripts at the top.
yes its available in 1.1, infact i do not like .net at all, javascript itself has nice regexp integration, but that javascipt unity is using seems to be some stripped down version :-/
well, i am a lazy guy, therefor i use non strictly typed variables a lot for quite a wile, didn’t crash the iphone sofar.
iPhone Unity doesn’t use dynamic typing, period. But you don’t have to type out the types in Javascript for it to be statically typed. The compiler figures it out for you.
ah
Forgot about that small difference in special cases where the type does not change like here
When JS slips into my project then only pragma strict with typing, saves me headache
C# has type inference in 3.0…if/when Unity gets that, then I believe your two lines of code above is also legal C# code without changing a single character.