objective-c

iOS9 WKWebview didReceiveAuthenticationChallenge called with host null

风格不统一 提交于 2021-02-08 06:33:14
问题 I am using WKWebview (iOS 9) to load https://self-signed.badssl.com/ While as a delegate didReceiveAuthenticationChallenge is getting called, I'm receiving incomplete protectionSpace details e.g. host is null & authenticationMethod is NSURLAuthenticationMethodDefault (it should be NSURLAuthenticationMethodServerTrust ) po challenge.protectionSpace <NSURLProtectionSpace: 0x7ff30c40fb90>: Host:(null), Server:http, Auth-Scheme:NSURLAuthenticationMethodDefault, Realm:(null), Port:0, Proxy:NO,

iOS9 WKWebview didReceiveAuthenticationChallenge called with host null

不打扰是莪最后的温柔 提交于 2021-02-08 06:33:10
问题 I am using WKWebview (iOS 9) to load https://self-signed.badssl.com/ While as a delegate didReceiveAuthenticationChallenge is getting called, I'm receiving incomplete protectionSpace details e.g. host is null & authenticationMethod is NSURLAuthenticationMethodDefault (it should be NSURLAuthenticationMethodServerTrust ) po challenge.protectionSpace <NSURLProtectionSpace: 0x7ff30c40fb90>: Host:(null), Server:http, Auth-Scheme:NSURLAuthenticationMethodDefault, Realm:(null), Port:0, Proxy:NO,

ANY possible way to run the clang compiler from a Sandboxed app?

邮差的信 提交于 2021-02-08 06:31:24
问题 OK, the question is fairly straightforward. I have a sandboxed OSX app. I want the user to be able to compile some C code (whatever he inputs). But whenever I'm attempting a call to: /usr/bin/env clang /the/path/to/the/source.c I'm getting the following error in the logs: xcrun: error: cannot be used within an App Sandbox. Is there any way to circumvent this? P.S. I've successfully done pretty much the same thing with Ruby, Python and PHP. 回答1: If you want to keep your app sandboxed you could

UIBezierPath containsPoint: don't work correctly?(Updated: touch location in superview how to handle?)

帅比萌擦擦* 提交于 2021-02-08 05:46:40
问题 So I have 2 UIViews witch can draw a bezierpath and then returns the path. Then I need to check if the path contains a point I do this with help of [path containsPoint:currentObject.position] and it works for one of the views but not the other. One view is on the top half of the iPhone and the other view is on the bottom half. The one on the bottom don't work. I tried to switch the views, and then it was the same problem, the bottom one doesn't work. Here is some code: in mainviewcontroller:

Programatically Set UIImage Animation with WatchKit

前提是你 提交于 2021-02-08 05:25:11
问题 I can't seem to figure out how to programmatically set a new image, via the outlet, and make it start animating. Sequence zeroEntering0.png zeroEntering1.png zeroEntering2.png zeroEntering3.png zeroEntering4.png I imported the sequence of images into the Image.xcassets inside the WatchKit App I can set the image in the interface builder to "zeroEntering" and set animating to "Yes" and it works correctly. However, I want something more dynamic, I need a button press to choose a new animation

NSTokenField: different colors for tokens

被刻印的时光 ゝ 提交于 2021-02-08 05:19:13
问题 I have created an NSTokenField in my xib. I'd like to display tokens with different colors inside that tokenField. Meaning: some tokens will be blue, the rest will be red (according to their content). Is that possible? The following code doesn't work for me. I hope someone can help me out: - (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString:(NSString *)editingString { id returnRepresentedObject = nil; NSTokenFieldCell *tf = [[NSTokenFieldCell alloc] init]; tf

Kotlin Native iOS string formatting with vararg

隐身守侯 提交于 2021-02-08 04:59:50
问题 Based on this issue about using NSString formatting I try to implement multiplatform implementation for formatting when using vararg , with no luck so far. What I did added FoundationInterop.def language = Objective-C --- #import <Foundation/NSString.h> NSString* format(NSString* format, ...) { va_list args; va_start(args, format); NSString* result = [[NSString alloc] initWithFormat:format arguments:args]; va_end(args); return result; } compiled it in gradle targets { final def iOSTarget =

How to properly escape single quotes in SQLite insert statement - iOS

大兔子大兔子 提交于 2021-02-08 04:56:09
问题 I have an insert statement for my sqlite table that contains apostrophes in the values. NSString *sqlInsert = [NSString stringWithFormat:@"insert into myTable (_id, name, area, title, description, url) VALUES (%i, '%@', '%@', '%@', '%@', '%@')", tempObject.ID, tempObject.name, tempObject.area, tempObject.title, tempObject.description, tempObject.url]; The results of that string is this insert into myTable (_id, name, area, title, description, url) VALUES (0, 'John Smith', 'USA', 'Programmer',

Draw IOSurfaces to another IOSurface

眉间皱痕 提交于 2021-02-08 04:39:43
问题 How can I draw a series of IOSurfaces to another then draw it to the screen? I've played around with some source from apple in the MultiGPU sample project, but the best I managed to do is draw a white screen or get tons of artifacts and crash the app. I'm very new to openGL and I don't quite understand the binding of framebuffers and textures and how they interact with IOSurfaces. This is what I have to create a texture from an IOSurface (directly from Apple's source) // Create an IOSurface

How to change NSToolBar background color?

我们两清 提交于 2021-02-08 03:56:12
问题 I'm using a NSToolbar and I'm trying to change the color to a white instead of the default gray. How can I accomplish that? 回答1: Since the toolbar integrates into the window title bar, you need to draw both the title bar and the toolbar. Which basically means you need to take over drawing for the entire window. This requires "swizzling" which, while it works well, is not supported by Apple and therefore may get your app rejected from the app store. Basically you need to inject your own code