Skip to content

Instantly share code, notes, and snippets.

View mafis's full-sized avatar
🏠
Working from home

Maximilian Fischer mafis

🏠
Working from home
View GitHub Profile
@mafis
mafis / UINavigationBar Custom Control
Created March 27, 2011 19:47
UINavigationBar Custom Control
using System;
using MonoTouch.UIKit;
using System.Drawing;
using MonoTouch.Foundation;
namespace CustomControls
{
public partial class CustomNavigationBar : UINavigationBar
{
validates_presence_of :name, :on => :create, :message => " can't be blank"
validates_uniqueness_of :name, :on => :create, :message => " already used"
#import <Cocoa/Cocoa.h>
@interface <#(ClassName *)className#> : NSObject
{
}
+ (<#(ClassName *)className#>*)sharedInstance;
@end
Dec 30 14:00:08 localhost kernel[0]: Darwin Kernel Version 10.5.0: Fri Nov 5 23:19:13 PDT 2010; root:xnu-1504.9.17~1/RELEASE_X86_64
Dec 30 14:00:08 localhost kernel[0]: vm_page_bootstrap: 508804 free pages and 15484 wired pages
Dec 30 14:00:08 localhost kernel[0]: kext submap [0xffffff7f80600000 - 0xffffff8000000000], kernel text [0xffffff8000200000 - 0xffffff8000600000]
Dec 30 14:00:08 localhost kernel[0]: standard timeslicing quantum is 10000 us
Dec 30 14:00:08 localhost kernel[0]: mig_table_max_displ = 73
Dec 30 14:00:08 localhost kernel[0]: AppleACPICPU: ProcessorId=0 LocalApicId=0 Enabled
Dec 30 14:00:08 localhost kernel[0]: AppleACPICPU: ProcessorId=1 LocalApicId=1 Enabled
Dec 30 14:00:08 localhost kernel[0]: AppleACPICPU: ProcessorId=2 LocalApicId=2 Disabled
Dec 30 14:00:08 localhost kernel[0]: AppleACPICPU: ProcessorId=3 LocalApicId=3 Disabled
Dec 30 14:00:08 localhost kernel[0]: calling mpo_policy_init for Quarantine
var activitiesController = [[ActivitiesController alloc] initWithCibName:@"ActivitiesController" bundle:nil];
[[activitiesController view] setFrame:[detailView bounds]];
[detailView addSubview:[activitiesController view]];
-(void)setName:(NSString*)name
{
self.name = name;
}
public class Test
{
public void test(string test)
{alert "Test";}
}
//
// Xcode324iOS41TestSuiteWorkaround.m
//
// This source file provides a work-around to enable running unit tests
// against the iPhone Simulator in Xcode 3.2.4 with iOS SDK 4.1.
//
// This work-around is only needed when using Xcode 3.2.4 to target iOS 4.1.
//
// Copyright 2010 Apple Inc. All rights reserved.
//
//
// Xcode324iOS41TestSuiteWorkaround.m
//
// This source file provides a work-around to enable running unit tests
// against the iPhone Simulator in Xcode 3.2.4 with iOS SDK 4.1.
//
// This work-around is only needed when using Xcode 3.2.4 to target iOS 4.1.
//
// Copyright 2010 Apple Inc. All rights reserved.
//
protected string GetMD5HashFromFile(string fileName)
{
if (!File.Exists(fileName))
return String.Empty;
FileStream file = new FileStream(fileName, FileMode.Open);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] retVal = md5.ComputeHash(file);
file.Close();