小编Mik*_*ike的帖子

如何在iOS 7下使用蓝牙键盘支持向上和向下箭头键

在iOS 6下,当使用外部蓝牙键盘和在模拟器中工作时,UITextView遵守向上和向下箭头键.在iOS 7下,向上和向下箭头键不再执行任何操作,但左右箭头键仍然移动光标.

在iOS 7下,如何在UITextView中支持来自外部键盘的向上和向下箭头键?

uitextview ios ios7

13
推荐指数
1
解决办法
4031
查看次数

iOS错误"请求无效部分的矩形"是什么意思?

谷歌没有发现此错误消息的帖子.我在iOS 5中尝试更新UITableView.虽然确切的代码有点折磨,但这正是我对表和具有表数据的NSMutableArray所做的.调用是通过performSelectorOnMainThread调用从主线程进行的,如下面的代码片段所示.NSMutableArray节是一个数组数组,每个数组表示一个节,其中这些辅助数组是NSStrings,其中包含表中显示的文本.

从主线程:

[table performSelectorOnMainThread: @selector(beginUpdates) withObject: nil waitUntilDone: YES];
Run Code Online (Sandbox Code Playgroud)

从另一个performSelectorOnMainThread调用的主代码:

// Make sure the requested section exists.
if (sections == nil)
    sections = [[NSMutableArray alloc] init];
while (section >= [sections count]) {
    NSMutableArray *newArray = [[NSMutableArray alloc] init];
    [sections addObject: newArray];

    [table insertSections: [NSIndexSet indexSetWithIndex: [sections count]] 
                                        withRowAnimation: UITableViewRowAnimationNone];
}

// Insert the new row in the section.
NSMutableArray *rowArray = [sections objectAtIndex: section];
if (row > [rowArray count])
    row = [rowArray count];
[rowArray insertObject: cellString atIndex: row];

[table …
Run Code Online (Sandbox Code Playgroud)

uitableview ios

9
推荐指数
1
解决办法
9876
查看次数

究竟什么是iOS上的BLE连接设备?

CBCentralManager retrieveConnectedPeripherals方法表明它获得了"当前连接到系统的外围设备列表".系统的定义在这里有点含糊不清.

这是否意味着我获得了连接到我的应用程序的外围设备列表,或连接到任何应用程序的外围设备列表?

如果我可以将外围设备连接到另一个应用程序,这是否也意味着多个应用程序可以连接到同一个外围设备?

只有当应用程序位于前台时才会发生这种情况,或者我是否需要考虑后台应用程序向外围设备发送命令的可能性我认为我的应用程序拥有?

ios core-bluetooth

9
推荐指数
1
解决办法
3126
查看次数

CBCharacteristicProperties是什么意思?

在iOS CBC特性类参考中,有一个用于返回特征属性的位图的描述.我正在寻找有关其中三个含义的信息.

文档列出如下:

CBCharacteristicProperties

特征的可能属性.

enum {
    CBCharacteristicPropertyBroadcast = 0x01,
    CBCharacteristicPropertyRead = 0x02,
    CBCharacteristicPropertyWriteWithoutResponse = 0x04,
    CBCharacteristicPropertyWrite = 0x08,
    CBCharacteristicPropertyNotify = 0x10,
    CBCharacteristicPropertyIndicate = 0x20,
    CBCharacteristicPropertyAuthenticatedSignedWrites = 0x40,
    CBCharacteristicPropertyExtendedProperties = 0x80,
};
Run Code Online (Sandbox Code Playgroud)

我找不到其他文档或这些属性的列表.

有些是显而易见的,如读,写和通知.广播记录在我发现的其他BLE文档中.

CBCharacteristicPropertyWriteWithoutResponse令人困惑.为什么这是旗帜?CBDevice调用writeValue:forCharacteristic:type:有一个接受以下内容的标志:

enum {
    CBCharacteristicWriteWithResponse = 0,
    CBCharacteristicWriteWithoutResponse,
};
Run Code Online (Sandbox Code Playgroud)

这些标志是多余的,还是必须提供writeValue类型:forCharacteristic:type:匹配CBCharacteristicProperties标志?

此外,CBCharacteristicPropertyIndi​​cate和CBCharacteristicPropertyExtendedProperties是什么意思?

是否有比Apple解释这些内容的文档更好的参考?

ios core-bluetooth

7
推荐指数
1
解决办法
4172
查看次数

获取UITextField选择更改通知的最佳方法是什么?

使用通知中心,如何为UITextField获取textDidChange(对于UISearchBar)方法中所述?,允许您在iOS UITextField中的文本发生更改时收到通知.我没有看到关于选择更改的类似通知.检测和响应UITextField选择中的更改的最佳方法是什么?

iphone uitextfield ipad ios

5
推荐指数
1
解决办法
3252
查看次数

CBPeripheral writeValue: forDescriptor 崩溃:

与 TI BLE 密钥卡建立连接并检索特征描述符后,我尝试调用

   [peripheral writeValue: nsData forDescriptor: descriptor];
Run Code Online (Sandbox Code Playgroud)

各种对象在调试器中看起来都很合理。nsData 有一个字节 1,peripheral 是从 iOS 返回的一个有效的 CBPeripheral 对象,descriptor 是一个由 iOS 返回的有效的 CBDescriptor。

我的应用程序因错误而崩溃

* -[CBConcretePeripheral writeValue:forDescriptor:]、/SourceCache/CoreBluetooth/CoreBluetooth-59.3/CBConcretePeripheral.m:358 中断言失败

关于为什么会发生这种情况或如何调试它有什么想法吗?

ios core-bluetooth cbperipheral

5
推荐指数
1
解决办法
2243
查看次数

如何为可变特征创建描述符?

用于CBMutableDescriptor:initWithType:value:传递类型参数的"标识特征的128位UUID" 的文档.然后它继续说你应该只使用一个CBUUIDCharacteristicUserDescriptionStringCBUUIDCharacteristicFormatString类型参数.最后,没有方法可以将描述符添加到可变特征中.

看来该参数正在做两个相互排斥的事情.一方面,它用于告诉O/S描述符适用的特征,另一方面,它用于设置描述符的类型.第二个更有意义,但是如何将描述符添加到特征中?

是否为特征传递UUID,或者CBUUIDCharacteristicUserDescriptionStringiOS崩溃

Assertion failure in -[CBMutableDescriptor initWithType:value:], /SourceCache/CoreBluetooth_Sim/CoreBluetooth-59.3/CBDescriptor.m:25
Run Code Online (Sandbox Code Playgroud)

创建CBMutableDescriptor并将其添加到CBMutableCharacteristic的正确方法是什么?

ios core-bluetooth

5
推荐指数
1
解决办法
3296
查看次数

在macOS 10.12.6上运行gitk时出错

我按照本SO post中的指示安装了brew和gitk 。我在macOS 10.12.6上运行。git仍然可以正常工作,但是当我尝试从终端运行gitk时,我得到:

Error in startup script: osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
    while executing
"exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes whose unix id is %d to true
        end te..."
    invoked from within
"if {[tk windowingsystem] eq "aqua"} {
    exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes …
Run Code Online (Sandbox Code Playgroud)

macos homebrew gitk

5
推荐指数
1
解决办法
487
查看次数

如何以编程方式选择MKUserLocation?

标题和副标题可以添加到iOS使用MKUserLocation显示的用户位置.当用户点击该位置时,这些将显示在该位置上方的气泡中.通过setSelected:animated:从MKAnnotationView中选择注释,可以显示其他注释的思想气泡.不幸的是,MKUserLocation并不是来自MKAnnotationView.

如何以编程方式选择用户位置,以便注释显示在用户位置上而无需用户首先点击它?

mkmapview mkannotation mkannotationview ios

3
推荐指数
1
解决办法
2442
查看次数

iOS蓝牙LE kCBAdvDataServiceUUID的格式是什么?

在centralManager中:didDiscoverPeripheral:advertisementData:RSSI(下面的完整代码),我在NSDictionary中找到一个名为kCBAdvDataServiceUUIDs的密钥.我正在尝试读取此数据以确定设备上可用的服务.这些数据的格式是什么?课程描述很简单

Unknown (<fff0>)
Run Code Online (Sandbox Code Playgroud)

这是来源:

- (void) centralManager: (CBCentralManager *) central
  didDiscoverPeripheral: (CBPeripheral *) aPeripheral
      advertisementData: (NSDictionary *) advertisementData
                   RSSI: (NSNumber *) RSSI
{
printf("Discovered %s\n", [[aPeripheral name] cStringUsingEncoding: NSUTF8StringEncoding]); // TODO: Remove printfs
    printf("  RSSI: %s\n", [[RSSI stringValue] cStringUsingEncoding: NSUTF8StringEncoding]);
    NSArray *keys = [advertisementData allKeys];
    for (int i = 0; i < [keys count]; ++i) {
        id key = [keys objectAtIndex: i];
        NSString *keyName = (NSString *) key;
        NSObject *value = [advertisementData objectForKey: key];
        if ([value isKindOfClass: [NSArray class]]) { …
Run Code Online (Sandbox Code Playgroud)

ios core-bluetooth

3
推荐指数
1
解决办法
7468
查看次数