This web page:
https://developers.google.com/cast/docs/ios_sender
Has the following sample code
1. self.deviceScanner = [[GCKDeviceScanner alloc] init];
2. GCKFilterCriteria *filterCriteria = [[GCKFilterCriteria alloc] init];
3. filterCriteria = [GCKFilterCriteria criteriaForAvailableApplicationWithID:@"YOUR_APP_ID_HERE"];
4. self.deviceScanner.filterCriteria = filterCriteria;
5. [self.deviceScanner addListener:self];
6. [self.deviceScanner startScan];
There are two problems with the sample above.
issue#1: Line 1 uses a deprecated API. (It probably should be initWithFilterCriteria:)
issue#2: Line 3 overwrites a variable that was instantiated just one line before.
Fix: I believe the correct (and far less confusing) code should look more
like.
1. GCKFilterCriteria *filterCriteria = GCKFilterCriteria criteriaForAvailableApplicationWithID:@"YOUR_APP_ID_HERE"];
2. self.deviceScanner = [[GCKDeviceScanner alloc] initWithFilterCriteria:filterCriteria];
3. [self.deviceScanner addListener:self];
4. [self.deviceScanner startScan];
Original issue reported on code.google.com by g...@clasp.tv on 17 Jun 2015 at 10:16
Original issue reported on code.google.com by
g...@clasp.tv
on 17 Jun 2015 at 10:16