core-foundation

NSCharacterSet - append another character set

半世苍凉 提交于 2019-12-08 14:52:50
问题 I would like to create a character set that includes all of its own characters, as well as those from another character set. Append in other words. I thought there'd be an obvious way, but after control-space completion in the IDE, and then poking around the docs, I couldn't fine anything. I can see how to append all the characters from a string. But I need to append the characters from another set. I guess I could to-string the second set, if there's a to-string method. How do I do this? 回答1

How to use CoreFoundation in QuickTime SDK for Windows?

余生长醉 提交于 2019-12-08 09:00:28
问题 Anybody can help me for compile this code in Cygwin / MingW / VS20(05|08|10)? Indeed i want to use CoreFoundation Framework in QuickTime SDK 7.3 for Windows. #include <stdio.h> #include <CoreFoundation.h> int main () { CFStringRef hello = CFSTR("Hello, world."); return 0; } i used this MakeFile for compile it, in Cygwin/MingW, but i get an error :( CC = gcc LDFLAGS = -L"C:/Program Files/QuickTime SDK/Libraries" -lQTMLClient CFLAGS = -Wall -mwindows -I"C:/Program Files/QuickTime SDK/CIncludes"

Ported OSX Obj-C/CG Screenshot Code to js-ctypes - crash on final line

北战南征 提交于 2019-12-08 06:31:48
问题 I ported some objective-c/CoreGraphics code that takes a screenshot of multiple monitors but it's not working. The jsctypes guys won't be able to help because the section is just me answering questions lol The objc/cg code is from here: https://stackoverflow.com/a/28247749/1828637 My jsctypes type/struct/declares are here: https://github.com/Noitidart/NativeShot/blob/mac-troubleshooting/modules/ostypes_mac.jsm The jsctypes port is here: https://github.com/Noitidart/NativeShot/blob/mac

ios making call programmatically without quitting app

◇◆丶佛笑我妖孽 提交于 2019-12-08 01:19:18
问题 Is there any way to make a call programmatically without exiting from current app? I did a research, but all answers are with: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; This is not what I want, I need also to access the voice stream. 回答1: If you're trying to make some kind of dialer - than NO . It's impossible in ios 回答2: What I understand from your question is to call and after you finish, go back to the app. Is it? Your scheme need look like this: NSURL

Retaining and “autoreleasing” in Core Foundation

时间秒杀一切 提交于 2019-12-07 23:14:43
问题 Let's say I'm writing my own function that takes in a CFDataRef object, does something to it, and returns another CFDataRef object: CFDataRef transformData(CFDataRef inData) { //Question 1: Should I call CFRetain(data) here to make sure it doesn't //go away? (This of course would involve releasing data just before returning //from this function, or as soon as I no longer need data.) CFDataRef outData; //Somehow produce the new outData from inData (and assume we are the //owner of outData,

NSDate as keys for NSDictionary

坚强是说给别人听的谎言 提交于 2019-12-07 07:10:24
问题 Is it possible to add NSDate as keys and some arrays as it values in a NSDictionary? I dont have any requirement of writing the dictionary to disk - archiving or unarchiving, just as this guy needs it: NSDictionary with NSDates as keys But, why I want NSDate to be added as keys specifically is so that I can fetch all keys from the dictionary and do some computations like, fetching the dates from within a range. Whether two objects with same date value share same memory when created? Is it

How to access CFDictionary in Swift 3?

自闭症网瘾萝莉.ら 提交于 2019-12-06 19:16:47
问题 I need to read and write some data from CFDictionary instances (to read and update EXIF data in photos). For the life of me, I cannot figure out how to do this in Swift 3. The signature for the call I want is: func CFDictionaryGetValue(CFDictionary!, UnsafeRawPointer!) How the heck do I convert my key (a string) to an UnsafeRawPointer so I can pass it to this call? 回答1: If you don't have to deal with other Core Foundation functions expecting an CFDictionary , you can simplify it by converting

iOS Crash Core Location CFBasicHashCreateCopy?

為{幸葍}努か 提交于 2019-12-06 19:12:18
问题 I've got this issue being reported via Crashlytics, although I've been unable to replicate it locally, so I've got nothing to go on other than the stack trace below.. Not sure if the references to CoreLocation in the stack trace have anything to do with it, but I'm not sure what could possibly be the cause. My project is using ARC. Any clue? Thread : Crashed: com.apple.CoreLocation.ConnectionClient.0x14eb3510.events 0 CoreFoundation 0x307769a8 CFBasicHashCreateCopy + 712 1 libobjc.A.dylib

How to programmatically make Mac OS X ICNS with 10 different images using sips or other

有些话、适合烂在心里 提交于 2019-12-06 13:58:43
问题 My issue is that i need have. I need to achieve this programmatically. So for mac os x an application icon should have these sizes: I have 10 images. Each one i placed a badge in the right corner, the placement and position of this badge does not scale. So i 10 different images. How to make a ICNS out of this? I thought to use sips, however sips only takes one file and it does all the scalings: http://cc.bingj.com/cache.aspx?q=mac+icns+sips+argument+list&d=5035141870911884&mkt=en-US&setlang

ios making call programmatically without quitting app

故事扮演 提交于 2019-12-06 12:52:24
Is there any way to make a call programmatically without exiting from current app? I did a research, but all answers are with: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; This is not what I want, I need also to access the voice stream. If you're trying to make some kind of dialer - than NO . It's impossible in ios What I understand from your question is to call and after you finish, go back to the app. Is it? Your scheme need look like this: NSURL *url= [NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@", phoneNumber]]; [[UIApplication