Skip to content

Instantly share code, notes, and snippets.

View macmade's full-sized avatar
🦄
I may be slow to respond.

JD Gadina macmade

🦄
I may be slow to respond.
View GitHub Profile

Coding Guidelines for Cocoa

Tips and Techniques for Framework Developers

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/FrameworkImpl.html#//apple_ref/doc/uid/20001286-BAJIBFHD

Object Sizes and Reserved Fields

Each Objective-C object has a size that can be determined by the total size of its own instance variables plus the instance variables of all superclasses. You cannot change the size of a class without requiring the recompilation of subclasses that also have instance variables. To maintain binary compatibility, you usually cannot change object sizes by introducing new instance variables into your classes or getting rid of unneeded ones.

- ( void )actionSheet: ( UIActionSheet * )actionSheet clickedButtonAtIndex: ( NSInteger )buttonIndex
{
NSLog( @"%i", buttonIndex );
if( buttonIndex == 0 )
{
SettingsView * settings = [ [ SettingsView alloc ] initWithNibName: @"SettingsView" bundle: nil ];
NSLog( @"%@", settings );
NSLog( @"%@", self.navigationController );
[ self.navigationController pushViewController: settings animated: YES ];
[ settings release ];
int * x;
int * y;
int z;
x = ( int * )calloc( 10, sizeof( int ) );
y = &( x[ 5 ] );
x = ( int * )realloc( x, 20 * sizeof( int ) );
z = *( y );
@macmade
macmade / BashStory
Created November 22, 2011 18:58
BashStory - When I tried to SSH my girlfriend
Girlfriend/BSD
Login: love
Password:
Login incorrect
Login: boyfriend
Password:
@macmade
macmade / objc-clang-warnings
Created November 18, 2011 15:00
Objective-C Clang Warning Flags
‎-Wall
-Wbad-function-cast
-Wcast-align
-Wconversion
-Wdeclaration-after-statement
-Wdeprecated-implementations
-Wextra
-Wfloat-equal
-Wformat=2
-Wformat-nonliteral
@macmade
macmade / ArchInfos
Created November 26, 2010 21:12
C / System informations
#include <stdio.h>
#define XSTR(s) STR(s)
#define STR(s) #s
int main( void )
{
printf
(
"\n"
@macmade
macmade / ASM Universe
Created November 26, 2010 20:05
The whole universe, coded with 236 characters of assembly code...
BITS 16
before_big_bang:
cli
mov ax, 0x07C0
mov ds, ax
mov es, ax