Skip to content

Commit a547422

Browse files
Reza JelvehMartin Grenfell
Reza Jelveh
authored and
Martin Grenfell
committed
added objc snippets
Signed-off-by: Martin Grenfell <[email protected]>
1 parent 4db862a commit a547422

16 files changed

+68
-0
lines changed

objc/I.snippet

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ (void) initialize
2+
{
3+
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWIthObjectsAndKeys:
4+
${1}@"value", @"key",
5+
nil]];
6+
}

objc/Imp.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#import "${1:`Filename()`.h}"${2}

objc/M.snippet

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
+ (${1:id}) ${2:method}
2+
{${3}
3+
return nil;
4+
}

objc/alloc.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[[${1:foo} alloc] init]${2};${3}

objc/array.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NSMutableArray *${1:array} = [NSMutable array];${2}

objc/bez.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NSBezierPath *${1:path} = [NSBezierPath bezierPath];${2}

objc/cat.snippet

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@interface ${1:NSObject} (${2:Category})
2+
@end
3+
4+
@implementation $1 ($2)
5+
${3}
6+
@end

objc/cati.snippet

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@interface ${1:NSObject} (${2:Category})
2+
${3}
3+
@end

objc/cli.snippet

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@interface ${1:ClassName} : ${2:NSObject}
2+
{${3}
3+
}
4+
${4}
5+
@end

objc/dict.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2}

objc/forarray.snippet

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
unsigned int ${1:object}Count = [${2:array} count];
2+
3+
for (unsigned int index = 0; index < $1Count; index++)
4+
{
5+
${3:id} $1 = [$2 $1AtIndex:index];
6+
${4}
7+
}

objc/log.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NSLog(@"${1}"${2});${3}

objc/objacc.snippet

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- (${1:id})${2:thing}
2+
{
3+
return $2;
4+
}
5+
6+
- (void) set$2:($1)
7+
{
8+
$1 old$2 = $2;
9+
$2 = [aValue retain];
10+
[old$2 release];
11+
}

objc/objc.snippet

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@interface ${1:`Filename('', 'object')`} : ${2:NSObject}
2+
{
3+
}
4+
@end
5+
6+
@implementation $1
7+
- (id) init
8+
{
9+
if (self = [super init])
10+
{${3}
11+
}
12+
return self
13+
}
14+
@end

objc/sel.snippet

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@selector(${1:method}:)${3}

objc/sm.snippet

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- (${1:id}) ${2:method}:(${3:id})${4:anArgument}
2+
{
3+
$1 res = [super $2:$4];${5}
4+
return res;
5+
}

0 commit comments

Comments
 (0)