Skip to content

Instantly share code, notes, and snippets.

View doronkatz's full-sized avatar
💭
Working on a Tesla SDK for iOS

Doron Katz doronkatz

💭
Working on a Tesla SDK for iOS
View GitHub Profile
//first type
NSArray *anArray = [[NSArray alloc] init];
//convenience method
NSString *aString = [[NSString alloc] stringWithFormat:@"something..%d.", anumber];
int main(void) {
NSAutoreleasePool *pool;
pool = [[NSAutoreleasePool alloc] init];
NSString *string;
string = [[[NSString alloc] init] autorelease];
/* use the string */
[pool drain];
}
-(void) dealloc {
[first release];
[last release];
[email release];
[super dealloc];
}
@doronkatz
doronkatz / AC_filterFunction.mxml
Created April 15, 2011 03:18
ArrayCollection FilterFunction in-line
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.collections.SortField;
import mx.collections.Sort;
import mx.collections.ArrayCollection;
[Bindable]
@doronkatz
doronkatz / YourUtilAppDelegate.m
Created April 22, 2011 00:53
Quick way to modify look of UITabBarController
#pragma mark UITabBarController customisation to add background image
//In your appDelegate, just use categories to add functionality to UITabBarController
//overloading viewDidLoad. No need to subclass
@implementation UITabBarController (UITabBarControllerCategory)
- (void)viewDidLoad {
[super viewDidLoad];
@doronkatz
doronkatz / Constants.m
Created October 23, 2011 03:33
Constants in Objective-C Header
//
// Constants.m
// myApp
//
// Created by Doron Katz on 15/06/11.
// Copyright 2011 doronkatz.com. All rights reserved.
//
//URLS
extern NSString* const kDBRestKitBaseURL;
@doronkatz
doronkatz / myApp.pch
Created October 23, 2011 03:44
A PCH File for global importing
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "TestFlight.h"
#import "Constants.h"
#endif
#define TESTING
@doronkatz
doronkatz / xcodeSwitch.sh
Created March 2, 2012 00:33
XCode switch script
$ sudo /usr/bin/xcode-select -switch /Applications/Xcode.app
'use strict';
var app = angular.module('chapter4App',
['directives', 'services']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {
controller: 'ListCtrl',
resolve: {
'use strict';
var app = angular.module('chapter4App',
['directives', 'services']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {
controller: 'ListCtrl',
resolve: {