Skip to content

Instantly share code, notes, and snippets.

View endash's full-sized avatar

Christopher Swasey endash

View GitHub Profile
@implementation MyCustomView : SCView
{
}
- (void)createChildViews
{
[self createChildViewWithClass: [self classFor: 'Label']]
[[self operatingView] addBinding: [[self content] pathFor: 'Subject'] forKey: 'title']
[[self operatingView] setLayout: [self translateFromFrame: [self Frame] byX: 5 andByY: 10]]
[self appendView: [self operatingView]]
>>> Editor.Page.find(1)['_page@102']
SC.Collection:@127 conditions=Object _bindings=[0] _observers=[0]
>>> Editor.Page.find(2)['_page@102']
SC.Collection:@128 conditions=Object _bindings=[0] _observers=[0]
>>> $I(Editor.Page.find(1)['_page@102'].conditions)
"#<Hash:{'page': Editor.Page({ guid=2 })}>"
>>> $I(Editor.Page.find(2)['_page@102'].conditions)
@endash
endash / gist:6845
Created August 22, 2008 19:48 — forked from anonymous/gist:6844
require('core');
// objects are created by passing an object literal to the create() method
//
// Ofapisurfer.mainController = SC.Object.create({}) ;
// is the same as
// var obj = {}
// Ofapisurfer.mainController = SC.object.create(obj);
//
sessionLength: function(key, value) {
if(value !== undefined) {
this.writeAttribute('sessionLength', value)
} else {
var sl = this.readAttribute('sessionLength') ;
if(sl > 0)
return sl;
return '0';
}