Created
April 11, 2014 20:26
-
-
Save rodericj/10498815 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure that we can see all of our associated devices | |
NSSet * associatedDeviceIDs = [MorseUser currentUser].associatedDevices; | |
[associatedDeviceIDs map:^(NSString * input) | |
{ | |
return input.lowercaseString; | |
}]; | |
NSSet * nearbyDeviceIDs = [[tempNearby allKeys] asSet]; | |
if(![associatedDeviceIDs isSubsetOfSet:nearbyDeviceIDs]) | |
{ | |
for(NSString * deviceID in associatedDeviceIDs) | |
{ | |
if(![nearbyDeviceIDs containsObject:deviceID.lowercaseString]) | |
{ | |
#ifdef GREEN_APP | |
NSString * name = [NSString stringWithFormat:@"%@'s Cone", [MorseUser currentUser].firstName]; | |
MorseDevice * device = [[MorseDevice alloc] initWithResourceID:@"tuned" andName:name andMorseID:deviceID.lowercaseString]; | |
#else | |
MorseDevice * device = [[MorseDevice alloc] initWithResourceID:@"tuned" andName:@"Tiburon" andMorseID:deviceID.lowercaseString]; | |
#endif | |
[device setLocallyViewable:YES]; | |
tempNearby[deviceID.lowercaseString] = device; | |
[self subscribeToAssociatedDevice:device]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems as though we are getting all of the associated devices, then adding them to tempNearby mapping which is self.nearbyDevices. If that is true, we'll never hit ATAssociatedDevicesNotSeen