小编Or *_*bel的帖子

iOS UIAutomation Simulator 5.0:目标应用程序似乎已经死亡

我正在尝试使用UIAutomation仅适用于Simulator 5.0 的记录功能.在Simulator 4.3上
使用UIAutomation时,它运行完美.在Simulator 5.0上从Xcode运行我的应用程序时,它运行完美.这排除了应用程序本身崩溃的可能性.

我尝试重置模拟器Reset Content and Settings.我尝试从我的应用程序的"派生数据"文件夹中选择目标,或者从模拟器应用程序文件夹中选择目标,没有任何效果.

有任何想法吗?

xcode instruments ios-ui-automation

18
推荐指数
1
解决办法
2761
查看次数

AVCaptureVideoDataOutput和设置kCVPixelBufferWidthKey&kCVPixelBufferHeightKey

我正试图AVCaptureVideoDataOutput通过设置kCVPixelBufferWidthKey&来捕获特定大小的帧kCVPixelBufferHeightKey.
问题是缓冲区的宽度和高度永远不会改变,它们总是会回来852x640

这是我的代码:

// Add the video frame output   
    self.videoOutput = [[AVCaptureVideoDataOutput alloc] init];
    [videoOutput setAlwaysDiscardsLateVideoFrames:YES];
// Use RGB frames instead of YUV to ease color processing
[videoOutput setVideoSettings:[NSDictionary dictionaryWithObjectsAndKeys:
                               [NSNumber numberWithFloat:320.0], (id)kCVPixelBufferWidthKey,
                               [NSNumber numberWithFloat:320.0], (id)kCVPixelBufferHeightKey,
                               [NSNumber numberWithInt:kCVPixelFormatType_32BGRA],(id)kCVPixelBufferPixelFormatTypeKey,
                                                              nil]];
 [videoOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];   
Run Code Online (Sandbox Code Playgroud)

编辑:来自iOS AVCaptureOutput.h:目前,唯一支持的键是kCVPixelBufferPixelFormatTypeKey.

谁知道设置输出缓冲区宽度/高度的工作方法?

iphone video-capture ios avcapturesession

6
推荐指数
1
解决办法
5044
查看次数

当点击'&'时,DocumentBuilder解析会中断字符串

我有这个xml:
<user>
<name>H &amp; M</name>

我用这段代码解析它:


    DocumentBuilder documentBuilder = null;
            Document document = null;

try { documentBuilder = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); document = documentBuilder.parse(is); } catch (Exception e) { return result; } NodeList nl = document.getElementsByTagName(XML_RESPONSE_ROOT); if (nl.getLength() > 0) { resp_code = nl.item(0).getAttributes().getNamedItem( XML_RESPONSE_STATUS).getNodeValue(); if (resp_code.equals(RESP_CODE_OK_SINGLE)) { nl = document .getElementsByTagName(XML_RESPONSE_TAG_CONTACT); NodeList values = nl.item(i).getChildNodes();
Run Code Online (Sandbox Code Playgroud)

等等..

当我得到节点值时:node.getNodeValue();

我只获得了&符号之前的内容,即使&符号被逃脱了

我想得到整个字符串:"H&M"

谢谢

java xml parsing dom escaping

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

iPhone上的OpenGL ES 2.0 - 我可以使用多少纹理单元?

在苹果的文档中:( http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html)

它说"PowerVR SGX上的OpenGL ES 1.1""有8个可用的纹理单元."

它没有说明OpenGL ES 2.0上有多少单位,这是否意味着没有限制?

iphone opengl-es ios

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

Postgres - SQL 查询计数为 2 列

我在 Postgres 中有一张表:

zone_name | trade_name   | client_name
G - WLA   | Garage Doors | King Garage Doors
J - SOC   | Attic        | Attic Jimmy
E - SGV2  | Attic        | Attic Jimmy
J - SOC   | Closets      | Brad Factory
E - SGV2  | Closets      | Brad Factory
AE - SFE  | Paint        | Chris Painting
E - SGV2  | Kitchen      | Joe Remodeling
Run Code Online (Sandbox Code Playgroud)

我试图创建一个表来显示有多少个客户端 ( client_name) 在同trade_name一个zone_name.

我一直在尝试使用GROUP BY但无法弄清楚。

有任何想法吗?

sql postgresql

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

OpenGL ES 2.0 iPhone - 在后台线程块主线程上渲染

我在后台线程上使用与主线程不同的EAGLContext渲染OpenGL上下文.

我使用这样的东西:

- (void)renderInBackground {
      EAGLContext *context = [[EAGLContext] alloc] init];
      [EAGLContext setCurrentContext:context];


       Rendering..
    }
Run Code Online (Sandbox Code Playgroud)

但是,即使这是在后台线程中执行,当使用重型着色器时,主线程也会被阻塞,并且UI会卡住.

为什么后台线程阻塞主线程?方法不同步.

iphone opengl-es opengl-es-2.0

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