Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fixed: missing protocol bug for @propety of type `id<...>` #226

merged 2 commits into from

2 participants


Fixed a bug which caused the first protocol token in a @property of type id<...> to not be parsed. Closes Issue #218


Just merged, thanks! Was on vacation so it took me a while :)

@tomaz tomaz merged commit 3ee2256 into tomaz:master
@mattrubin mattrubin deleted the unknown repository branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 2, 2012
  1. @mattrubin

    Fixed a bug which caused the first protocol token in a @property of t…

    mattrubin authored
    …ype `id<...>` to not be parsed. Closes Issue #218
  2. @mattrubin
This page is out of date. Refresh to see the latest.
1  Model/GBMethodData.m
@@ -74,7 +74,6 @@ + (id)propertyDataWithAttributes:(NSArray *)attributes components:(NSArray *)com
nextComponentIsPropertyName = YES;
} else if ([component isEqualToString:@"id"]) {
[results addObject:component];
- nextComponentIsPropertyName = YES;
} else if ([component isMatchedByRegex:@"^[_a-zA-Z][_a-zA-Z0-9]$"]) {
if (results.count == 0 || inProtocolsList) {
[results addObject:component];
4 Testing/GBObjectiveCParser-MethodsParsingTesting.m
@@ -283,12 +283,12 @@ - (void)testParseObjectsFromString_shouldRegisterComplexPropertyDefinition2 {
GBObjectiveCParser *parser = [GBObjectiveCParser parserWithSettingsProvider:[GBTestObjectsRegistry mockSettingsProvider]];
GBStore *store = [[GBStore alloc] init];
// execute
- [parser parseObjectsFromString:@"@interface MyClass @property (weak) IBOutlet id delegate; @end" sourceFile:@"filename.h" toStore:store];
+ [parser parseObjectsFromString:@"@interface MyClass @property (weak) IBOutlet id<Protocol> delegate; @end" sourceFile:@"filename.h" toStore:store];
// verify
GBClassData *class = [[store classes] anyObject];
NSArray *methods = [[class methods] methods];
assertThatInteger([methods count], equalToInteger(1));
- [self assertMethod:[methods objectAtIndex:0] matchesPropertyComponents:@"weak", @"IBOutlet", @"id", @"delegate", nil];
+ [self assertMethod:[methods objectAtIndex:0] matchesPropertyComponents:@"weak", @"IBOutlet", @"id", @"<", @"Protocol", @">", @"delegate", nil];
- (void)testParseObjectsFromString_shouldRegisterBlockPropertyDefinition {
Something went wrong with that request. Please try again.