mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
45 lines
892 B
Plaintext
45 lines
892 B
Plaintext
# -*- mode: snippet -*-
|
|
# key: arracc
|
|
# contributor: Translated from TextMate Snippet
|
|
# name: KVC Array
|
|
## condition: "(source.objc | source.objc++) & meta.scope.implementation.objc - meta.function-with-body"
|
|
# --
|
|
- (void)addObjectTo${1:Things}:(${2:id})anObject
|
|
{
|
|
[${3:${1/./\l$0/}} addObject:anObject];
|
|
}
|
|
|
|
- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i
|
|
{
|
|
[$3 insertObject:anObject atIndex:i];
|
|
}
|
|
|
|
- ($2)objectIn$1AtIndex:(unsigned int)i
|
|
{
|
|
return [$3 objectAtIndex:i];
|
|
}
|
|
|
|
- (unsigned int)indexOfObjectIn$1:($2)anObject
|
|
{
|
|
return [$3 indexOfObject:anObject];
|
|
}
|
|
|
|
- (void)removeObjectFrom$1AtIndex:(unsigned int)i
|
|
{
|
|
[$3 removeObjectAtIndex:i];
|
|
}
|
|
|
|
- (unsigned int)countOf$1
|
|
{
|
|
return [$3 count];
|
|
}
|
|
|
|
- (NSArray${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})${1/./\l$0/}
|
|
{
|
|
return $3;
|
|
}
|
|
|
|
- (void)set$1:(NSArray${TM_C_POINTER/(^(.+?)\s*$)?/(?1:$2: *)/})new$1
|
|
{
|
|
[$3 setArray:new$1];
|
|
} |