Skip to content

Instantly share code, notes, and snippets.

View mako34's full-sized avatar
💭
automagickally

manuelBetancurt mako34

💭
automagickally
View GitHub Profile
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return objectArray.count;
}
@mako34
mako34 / delegate reminder
Last active December 28, 2015 15:39
iOS, objC : delegate reminder
/////
# MyMuch.h
@protocol MyMuchDelegate;
@interface MyMuch : MyMuchViewController
{
//id<MyMuchDelegate> _delegate; //new style not needed
}
@mako34
mako34 / PHP_push_iOS.php
Last active May 3, 2020 13:04
PHP test for iOS push notification
<?php
// Provide the Host Information.
$tHost = 'gateway.sandbox.push.apple.com';
$tPort = 2195;
// Provide the Certificate and Key Data.
@mako34
mako34 / iOS_blocks
Last active January 4, 2016 15:59
iOS blocks,
// since iOS 4, extension C lang
//AKA, lambdas, anonimous functions, clousures
//function that can be stored as a variable (referred to as a "first-class function")
//clousure scope incorporates parent scope "close"
//encapsulate chunks of code and pass them around like any other object
//As well as containing executable code, a block also has the ability to capture state from its enclosing scope.
@mako34
mako34 / processing2ardu
Created March 29, 2014 12:16
Processing talks to Arduino
//http://everybody.is-a-cyb.org/project/21
//PROCESSING WRITES TO ARDUINO
import processing.serial.*;
// The serial port:
Serial myPort;
int value = 0;
//http://everybody.is-a-cyb.org/project/21
//PROCESSING WRITES TO ARDUINO
import processing.serial.*;
// The serial port:
Serial myPort;
int value = 0;
//MyCell.h
@protocol MyCellDelegate <NSObject>
-(void)cellCheckBoxWasChanged:(MyCell *)cell;
@end
@interface MyCell : NSObject
@mako34
mako34 / iOS_completion_block
Created July 19, 2014 01:09
iOS completion block
//define before implementation
typedef void(^myCompletion)(BOOL);
//method todo after implementation
-(void) myMethod:(myCompletion) compblock{
//do stuff
for (int i = 0; i < 100; i++) {
NSLog(@"i :: %d", i);
}
@mako34
mako34 / DLog iOS
Created July 21, 2014 07:22
Dlog iOS
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"\n%s [Line %d] \n" fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...) /* */
#endif
void uncaughtExceptionHandler(NSException*);
@implementation AppDelegate
void uncaughtExceptionHandler(NSException *exception)
{
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);