小编Aud*_*ble的帖子

iOS 7 CoreBluetooth retrievePeripheralsWithIdentifiers未检索

我有一个问题是将我的CoreBluetooth代码从iOS 6更新到iOS 7.我可以扫描外围设备并建立连接,但是,我无法使用iOS 7中提供的新CoreBluetooth方法重新连接外围设备.这里是一个看看我是如何尝试完成重新连接的:

- (void)retrievePeripheral:(NSString *)uuidString
{

NSUUID *nsUUID = [[NSUUID UUID] initWithUUIDString:uuidString];

if(nsUUID)
{        
    NSArray *peripheralArray = [centralManager retrievePeripheralsWithIdentifiers:@[nsUUID]];

    // Check for known Peripherals
    if([peripheralArray count] > 0)
    {
        for(CBPeripheral *peripheral in peripheralArray)
        {
            NSLog(@"Connecting to Peripheral - %@", peripheral);

            [self connectPeripheral:peripheral];
        }
    }
    // There are no known Peripherals so we check for connected Peripherals if any
    else
    {
        CBUUID *cbUUID = [CBUUID UUIDWithNSUUID:nsUUID];

        NSArray *connectedPeripheralArray = [centralManager retrieveConnectedPeripheralsWithServices:@[cbUUID]];

        // If there are connected Peripherals
        if([connectedPeripheralArray count] …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ipad core-bluetooth ios7

8
推荐指数
1
解决办法
9146
查看次数

Xcode UI测试 - 如何在WebView中查找并点击()元素

我试图找到一种方法来点击具有以下HTML结构的链接:

<a>
  <div id="facebook_sharing"></div>
</a>
Run Code Online (Sandbox Code Playgroud)

a标签没有与之相关联的,只是任何属性或文本div标签内.

我尝试了以下但没有成功:

app.links["facebook_sharing"].tap()
Run Code Online (Sandbox Code Playgroud)

有没有办法找到div标签元素并点击它?

谢谢!

xcode ios xcode-ui-testing uitest

4
推荐指数
1
解决办法
5661
查看次数