Monotouch, again.

Nov 12, 2012 at 9:39 PM

Hi Joe! I was so impressed by LinqToTwitter that I'm now trying to bring it to the iPhone using Monotouch. I read here that someone tried that about two years ago but I'm not sure how it worked out for him in the end...

Here's an update anyway: LinqToTwitter works great! ...In the iPhone simulator. Unfortunately, it doesn't work at all on the real device. This is apparently due to Monotouch having to ahead-of-time compile everything to work around Apple's iOS restrictions (no JIT compilation allowed). So, when trying to run the application on the device with this simple query

from search in ctx.Search
  where search.Type == SearchType.Search &&
  search.Query == "Linq"
  select search;

...it crashes with this stack trace:

http://pastebin.com/raw.php?i=TT7RdLR4

But like I said, the library works great on the device simulator (seeing LinqToWtitter.DLL compiled in Windows work on Apple hardware, even simulated, is simply amazing). So without knowing the slightest thing about the actual source code I ask the expert on the subject, what do you think? Would it be even remotely possible to get this beast working without the need for JIT compilation or should I just give up now?

Coordinator
Nov 12, 2012 at 11:05 PM

Hi,

I'm reading the Xamarin limitations documentation at http://docs.xamarin.com/ios/about/limitations. Looking at the stack trace, it seems that my dynamic generic method implementation in TwitterQueryable.Execute is where this is happening. Unfortunately, I don't see an immediate solution for this because I intentionally used reflection to give me a strongly typed TwitterContext implementation. I might try to tackle this some time in the future, but it requires more attention in the short term than I currently have for it.

Thanks for looking at this and letting me know.

@JoeMayo

Nov 12, 2012 at 11:27 PM

Thanks for your reply! I was afraid you'd say this... I just briefly looked at the source code before your reply and gave up fairly quickly. The code is in really great shape though! Now I have to decide if I'll roll my own ugly hack to talk to Twitter, or see if I can hard code the query I'm trying to do into LinqToTwitter - I don't really like either of those two alternatives though :(

Kind regards

Victoria

Nov 12, 2012 at 11:30 PM

Monotouch has some built in twitter capability, not sure if it does what you want, but I have ran a demo they have that lets you post to twitter.

From: victorias [email removed]
Sent: Monday, November 12, 2012 4:28 PM
To: Condron, Chuck
Subject: Re: Monotouch, again. [LinqToTwitter:402932]

From: victorias

Thanks for your reply! I was afraid you'd say this... I just briefly looked at the source code before your reply and gave up fairly quickly. The code is in really great shape though! Now I have to decide if I'll roll my own ugly hack to talk to Twitter, or see if I can hard code the query I'm trying to do into LinqToTwitter - I don't really like either of those two alternatives though :(

Kind regards

Victoria