Skip to content

Commit

Permalink
Add formal protocols and implementation definitions to avoid undeclar…
Browse files Browse the repository at this point in the history
…ed selectors
  • Loading branch information
tonyarnold committed Jan 1, 2014
1 parent f5a1edc commit 36411f0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MagicalRecord.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = NO;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
Expand Down Expand Up @@ -1304,7 +1304,7 @@
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = NO;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@

@end

@protocol MagicalRecord_MOGenerator <NSObject>

@optional
- (instancetype) entityInManagedObjectContext:(NSManagedObjectContext *)object;
- (instancetype) insertInManagedObjectContext:(NSManagedObjectContext *)object;

@end
1 change: 1 addition & 0 deletions Tests/DataImport/MagicalDataImportTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
@property (nonatomic, strong) id testEntity;

- (Class) testEntityClass;
- (void) setupTestData;

@end
9 changes: 6 additions & 3 deletions Tests/DataImport/MagicalDataImportTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ - (void)setUp
[MagicalRecord setDefaultModelFromClass:[self class]];
[MagicalRecord setupCoreDataStackWithInMemoryStore];

if ([self respondsToSelector:@selector(setupTestData)]) {
[self performSelector:@selector(setupTestData)];
}
[self setupTestData];

self.testEntityData = [self dataFromJSONFixture];
}
Expand All @@ -40,4 +38,9 @@ - (Class)testEntityClass;
return [NSManagedObject class];
}

- (void)setupTestData
{
// Implement this in your subclasses
}

@end

0 comments on commit 36411f0

Please sign in to comment.