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
@import <Foundation/CPString.j>
@implementation CPStringTest : OJTestCase
- (void)testStringByReplacingOccurrencesOfStringWithString
{
var expectedString = @"hello world. A new world!";
var dummyString = @"hello woold. A new woold!";
var actualString = [dummyString stringByReplacingOccurrencesOfString:@"woold" withString:@"world"];
[self assertTrue:(expectedString === actualString)
@import "../Extensions/CPViewController/CPViewController.j"
@import "../Extensions/CPActiveRecord/CPActiveRecord.j"
@implementation TableViewController : UIViewController
{
CPArray data;
CPActiveRecord record @accessors;
@outlet CPTableView tableView;
}
//Methode zum berechnen der absoluten Position
- (NSInteger)realRowNumberForIndexPath:(NSIndexPath *)indexPath inTableView:(UITableView *)tableView
{
NSInteger retInt = 0;
if (!indexPath.section)
{
return indexPath.row;
}
for (int i=0; i<indexPath.section;i++)
- (void)viewDidLoad {
//Editier Button des UIViewControllers auf die Rechte Seite der Navigationbar hinzufügen
self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
//Hier einfach das Wechseln der Anzeige zwischen Editieren & Normaler Anzeige programmieren
Process: WebKitPluginHost [233]
Path: /System/Library/Frameworks/WebKit.framework/WebKitPluginHost.app/Contents/MacOS/WebKitPluginHost
Identifier: com.apple.WebKit.PluginHost
Version: 6533 (6533.13)
Build Info: WebKitPluginHost-75331300~2
Code Type: X86 (Native)
Parent Process: WebKitPluginAgent [232]
PlugIn Path: /Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player
PlugIn Identifier: com.macromedia.Flash Player.plugin
NSMutableArray* points = [[NSMutableArray alloc] initWithCapacity:coordinates.count];
for(int idx = 0; idx < coordinates.count; idx++)
{
Koordinate* coord = (Koordinate*)[coordinates objectAtIndex:idx];
CLLocation* currentLocation = [[[CLLocation alloc] initWithLatitude:coord.coordinate.latitude longitude:coord.coordinate.longitude] autorelease];
[points addObject:currentLocation];
}
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();
//
// 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.
//
public class Test
{
public void test(string test)
{alert "Test";}
}