Skip to content

Commit dce7d70

Browse files
(fix):remove warnings from build (#370)
* remove warnings from build * bump up the os from 9.2 to 9.4 for travis * looking at failure on travis of universal * upgrading to xcode 10
1 parent 20e8ded commit dce7d70

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode9.4
2+
osx_image: xcode10
33
branches:
44
only:
55
- master
@@ -8,7 +8,7 @@ env:
88
- SCHEME=OptimizelySDKiOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=9.1 NAME='iPad Air'
99
- SCHEME=OptimizelySDKiOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=10.1 NAME='iPhone 7 Plus'
1010
- SCHEME=OptimizelySDKiOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=10.3.1 NAME='iPhone 7'
11-
- SCHEME=OptimizelySDKiOS-Universal TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=9.3 NAME='iPhone 6s'
11+
- SCHEME=OptimizelySDKiOS-Universal TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=11.1 NAME='iPhone 6s'
1212
- SCHEME=OptimizelySDKTVOS TEST_SDK=appletvsimulator PLATFORM='tvOS Simulator' OS=10.2 NAME='Apple TV 1080p'
1313
- SCHEME=OptimizelySDKTVOS-Universal TEST_SDK=appletvsimulator PLATFORM='tvOS Simulator' OS=9.2 NAME='Apple TV 1080p'
1414
before_install:

OptimizelySDKCore/OptimizelySDKCore/OPTLYEventTagUtil.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ + (NSNumber *)getNumericValue:(NSDictionary *)eventTags logger:(id<OPTLYLogger>)
106106
// if the object is an NSNumber, then char, floats, and boolean values will be cast to a double int
107107
if ([value isKindOfClass:[NSNumber class]]) {
108108
answer = (NSNumber*)value;
109-
const char *objCType = [answer objCType];
110109

111110
if ([self isNSNumberBoolean:answer]) {
112111
answer = nil;

OptimizelySDKShared/OptimizelySDKShared/OPTLYManagerBase.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ - (void)cleanUserProfileService:(NSArray<OPTLYExperiment *><OPTLYExperiment> *)e
8686
//#pragma clang diagnostic push
8787
//#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
8888
@try {
89-
[(NSObject *)self.userProfileService performSelector:selector withObject:ids];
89+
IMP imp = [self.userProfileService.class instanceMethodForSelector:selector];
90+
void (*func)(id, SEL, NSArray *) = (void *)imp;
91+
func(self.userProfileService, selector, ids);
9092
}
9193
@catch(NSException *e) {
9294
[self.logger logMessage:@"Error cleaning up user profile service" withLevel:OptimizelyLogLevelError];

OptimizelySDKUserProfileService/OptimizelySDKUserProfileServiceTests/OptimizelySDKUserProfileServiceTests.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,14 @@ - (void)testWhitelistingOverridesUserProfileAndStoresNothing {
316316
- (void)testRemoveInvalidExperiments
317317
{
318318
if (self.userProfileService ) {
319-
[self.userProfileService performSelector:@selector(removeInvalidExperimentsForAllUsers:) withObject:@[]];
320-
[self.userProfileService performSelector:@selector(removeInvalidExperimentsForAllUsers:) withObject:nil];
321-
[self.userProfileService performSelector:@selector(removeInvalidExperimentsForAllUsers:) withObject:@[kExperimentId3a]];
319+
SEL selector = NSSelectorFromString(@"removeInvalidExperimentsForAllUsers:");
320+
321+
IMP imp = [self.userProfileService.class instanceMethodForSelector:selector];
322+
void (*func)(id, SEL, NSArray *) = (void *)imp;
323+
324+
func(self.userProfileService, selector, @[]);
325+
func(self.userProfileService, selector, nil);
326+
func(self.userProfileService, selector, @[kExperimentId3a]);
322327
}
323328
NSDictionary *userProfile1 = [self.userProfileService lookup:kUserId1];
324329
XCTAssertNil(userProfile1[kExperimentId3a], @"User profile experiment entry should be removed");

0 commit comments

Comments
 (0)