Skip to content

Instantly share code, notes, and snippets.

View hammerdr's full-sized avatar

Derek Hammer hammerdr

View GitHub Profile
@implementation TestClass : CPObject
{
CPNotificationCenter notification @accessors;
}
- (void)init
{
var test = function() { return "Bob"; };
return [super init];
}
- (void)assert:(id)target registered:(CPString)aNotification
{
var names = [[CPNotificationCenter defaultCenter]._namedRegistries keyEnumerator];
while (name = [names nextObject])
{
if([name isEqualToString:aNotification])
{
var registry = [[CPNotificationCenter defaultCenter]._namedRegistries objectForKey:name];
var objects = [registry._objectObservers keyEnumerator];
An error occured while building:
Syntax error in UITestScriptParser.j on preprocessed line number 15
for(var i = 0; i < objj_msgSend(data, "count"); i++)
{
if(objj_msgSend(data, "objectAtIndex:", i).match("^#") || objj_msgSend(data, "objectAtIndex:", i).match(/^\
|| objj_msgSend(data, "objectAtIndex:", i).match(/^Comment/) || objj_msgSend(data, "objectAtIndex:", i).match(/^\s*$/))
{
private int deleteInternal(Uri url, String userWhere, String[] whereArgs) {
String tableToChange;
// In some cases a given url requires that we delete rows from more than one
// table. The motivating example is deleting messages from both the on disk
// and in memory messages tables.
String tableToChange2 = null;
String idColumnName = null;
String changedItemId = null;
String provider = null;
...
- (void)loadEverything
{
loginController = [[LoginWindowController alloc] init...];
[loginController setDelegate:self];
}
- (void)someFunction
{
@import <AppKit/CPTableView.j>
@implementation CPTableView (DoubleClick)
- (void)mouseDown:(CPEvent)anEvent
{
if ([anEvent clickCount] == 2)
{
var index = [[self selectedRowIndexes] firstIndex];
@import <AppKit/CPWindow.j>
@import "../models/OLFeedback.j"
@implementation OLFeedbackWindow : CPWindow
{
CPView _feedbackView;
CPView _submittingFeedbackView;
CPView _submittedFeedbackView;
CPView _currentView; // Keeps track of the current content view
- (void)didSubmitRegistration:(CPDictionary)registrationInfo
{
}
class OJMoq
{
OJMoqSelector Selector(SEL aSelector)
{
var theSelector = new OJMoqSelector(aSelector);
selectors.Add(theSelector);
return theSelector;
}
class Autotest
def make_test_cmd files_to_test
return "objj RunTests.j"
end
end