Skip to content

Instantly share code, notes, and snippets.

View kevinmcmahon's full-sized avatar

Kevin McMahon kevinmcmahon

View GitHub Profile
* Assertion at ../../../../mono/mini/debugger-agent.c:2767, condition `!tls' not met
Stacktrace:
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x000e8>
at TestApp.Application.Main (string[]) [0x00000] in /Users/kevin/Projects/TestApp/TestApp/Main.cs:11
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0x000cb>
Native stacktrace:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null
#specify the root of your source tree below
$path = "C:\Code\chatsworth"
$ns = "http://schemas.microsoft.com/developer/msbuild/2003"
$xname = [System.Xml.Linq.XName]::Get("PropertyGroup",$ns)
$tfname = [System.Xml.Linq.XName]::Get("TargetFrameworkVersion",$ns)
$xws = New-Object System.Xml.XmlWriterSettings
@kevinmcmahon
kevinmcmahon / ObjectiveCParser.cs
Created August 7, 2010 02:38
An Objective C brute force parser from #monotouch irc
// no claim or warranty is made on this code
// it is very brute force
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
@kevinmcmahon
kevinmcmahon / HackMulitpleDetailViews RowSelected Method
Created November 24, 2010 06:23
Totally hack fix to MultipleDetailViews
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
int row = indexPath.Row;
ISubstitutableDetailViewController dvc = null;
if(row == 0)
{
dvc = new FirstDetailView();
}
@kevinmcmahon
kevinmcmahon / GoogleSearchResults.cs
Created March 7, 2011 18:17
POCO representation of GoogleSearchResults JSON
/// Deserialise from JSON
[Serializable]
public class GoogleSearchResults
{
public GoogleSearchResults() { }
public GoogleSearchResults(string _unescapedUrl, string _url, string _visibleUrl, string _cacheUrl, string _title, string _titleNoFormatting, string _content)
{
this.unescapedUrl = _unescapedUrl;
this.url = _url;
this.visibleUrl = _visibleUrl;
@kevinmcmahon
kevinmcmahon / gist:877696
Created March 19, 2011 18:38
MonoTouch Binding Help
NOTE: This is pulled from an email exchange and hopefully will be polished up and published as a blog post at http://blog.kevfoo.com but until then I'll just dump it here in a gist. If you have any questions leave comments or ask them in #monotouch on IRC. (I am klmcmahon on IRC)
<Begin Excerpt>
I'm going to do a quick brain dump and attach some code for a generator that was passed around on the #monotouch IRC channel. This is extremely raw and stream of conscious but probably what will become the blog post when it gets fleshed out better.
Step 1: You _HAVE_ to have a static library that has been compiled without THUMB code being generated. (NOTE: I haven't upgraded to iOS 4.3 tools and XCode yet but apparently this isn't the case anymore since Apple appears to have fixed the bug) There is a linker bug that Apple introduced and has yet to fix that causes problems at compile time when trying to link in static libraries with THUMB enabled. You can run a command via the shell to check the dumped output (here
_dropnetClient.GetFile(selected.Path, (RestSharp.RestResponse r) => {
try {
using(FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite))
using(BinaryWriter bw = new BinaryWriter(fs))
{
bw.Write(r.RawBytes);
}
}
@kevinmcmahon
kevinmcmahon / gist:938870
Created April 23, 2011 18:51
Code Camp Session Data XML
<sessions version="1">
<category name="Regular Sessions">
<session>
<title>let cygwin take you to a whole gnu world</title>
<speaker>
<name>Ryan Gerry</name>
<company></company>
<bio>A software craftsman with eight years of professional experience.</bio>
<headshot></headshot>
</speaker>
@kevinmcmahon
kevinmcmahon / gist:949755
Created April 30, 2011 15:36
Example showing a non-Thumb static iOS library using otool
otool -tv libfacebook_ios_sdk.a
Archive : libfacebook_ios_sdk.a (architecture armv6)
libfacebook_ios_sdk.a(FBRequest.o) (architecture armv6):
(__TEXT,__text) section
-[FBRequest loading]:
00000000 e59f3010 ldr r3, [pc, #16] ; 0x18
00000004 e79f3003 ldr r3, [pc, r3]
00000008 e7900003 ldr r0, [r0, r3]