core-foundation

iOS Crash Core Location CFBasicHashCreateCopy?

和自甴很熟 提交于 2019-12-05 01:42:22
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 0x3afd1a19 object_setClass + 24 2 CoreFoundation 0x30782d0f CFDictionaryCreateMutableCopy + 154 3

where to download for apple's open source core foundation?

谁都会走 提交于 2019-12-04 22:16:35
问题 where should I download the core foundation library? I have a program that includes CoreFoundation/CoreFoundation.h ... It is an iPhone app, but I'm thinking the core foundation code will run on linux. 回答1: All Apple's open source code can be found in http://opensource.apple.com/. The source code of Core Foundation (actually, "CFLite") can be found in http://www.opensource.apple.com/source/CF/CF-635.19/, and can be downloaded from http://www.opensource.apple.com/tarballs/CF/CF-635.19.tar.gz.

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

∥☆過路亽.° 提交于 2019-12-04 19:58:52
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=en-US&w=n3PZcWn6bEPxt4O96PPLd6nugtVq5jDz Is there a way to make /usr/bin/sips take my 10 images and make

Using IOKit to return Mac's Serial number returns 4 extra characters

南楼画角 提交于 2019-12-04 18:30:41
I'm playing with IOKit and have the following code, the general idea is to pass a platformExpert key to this small core foundation command line application and have it print the decoded string. The test case is "serial-number". The code below when run like: ./compiled serial-number Almost works but returns the last 4 characters of the serial number at the beginning of the string i.e. for an example serial such as C12D2JMPDDQX it would return DDQXC12D2JMPDDQX Any ideas? #include <CoreFoundation/CoreFoundation.h> #include <IOKit/IOKitLib.h> int main (int argc, const char * argv[]) { CFStringRef

How do I implement a bit array in C / Objective C

自古美人都是妖i 提交于 2019-12-04 17:35:21
问题 iOS / Objective-C: I have a large array of boolean values. This is an inefficient way to store these values – at least eight bits are used for each element when only one is needed. How can I optimise? 回答1: see CFMutableBitVector/CFBitVector for a CFType option 回答2: Try this: #define BITOP(a,b,op) \ ((a)[(size_t)(b)/(8*sizeof *(a))] op ((size_t)1<<((size_t)(b)%(8*sizeof *(a))))) Then for any array of unsigned integer elements no larger than size_t , the BITOP macro can access the array as a

Get peer IP address and port on OSX in objective-c from NSStream, CFStream or Socket

痴心易碎 提交于 2019-12-04 17:20:13
I have written a server that listens on a specific port for incoming tcp connections. To manage the network connectivity I am using Streams (CFStream/NSStream). When a connection is esthablished I save all the information about this very connection in another instance of a dedicated class which is also set as the delegate for the streams. Now I want to get the public IP of the device that sends me a message through the already esthablished streams, in other words, I would like to store the IP of the stream's peer. I tried many things, but unfortunately I only get null-values. Is there a

CFDictionaryRef issues in Swift

痴心易碎 提交于 2019-12-04 17:09:54
I'm converting some of my older Objective-C code to Swift so I can move away from some deprecated methods but I keep getting a crash and so far I can't seem to figure out what's causing it. I'm getting a private key from a P12 Certificate and this method seems to work fine up until I get to the part where I actually need to get the dictionary from the CFArray, and even though the array has values in it the app keeps crashing. Here's the code that I have : func privateKeyFromCertificate(p12Name: String, withPassword password: String) -> SecKeyRef { let resourcePath: String = NSBundle.mainBundle

When do these objects get released under ARC?

我是研究僧i 提交于 2019-12-04 14:17:05
I have a few questions about ARC (automatic reference counting): CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath]; //Question 1: Here, I would expect the NSURL object to be autoreleased and //therefore the CFURLRef will also be available for “a while.” Is this correct? url = NULL; //Question 2: Will this cause the NSURL to be released immediately? NSURL *url = [NSURL fileURLWithPath:appPath]; url = nil; //Question 3: Does the “url = nil” result in an immediate release of the NSURL? NSURL *url = [[NSURL alloc] initWithString:@"/something"]; url = nil; //Question 4: What about

Core Foundation equivalents for NSURLRequest and NSURLConnection

柔情痞子 提交于 2019-12-04 12:44:40
I'm aware that NSUrl is bridged to CFUrl. What are the Core Foundation equivalents for NSURLRequest and NSURLConnection so I can do something with a CFUrl object using pure C? There are not direct equivalents to NSURLRequest and NSURLConnection in Core Foundation, but you can use the lower-level CFHTTP functions in CFNetwork . For example, CFHTTPMessageRef myRequest = CFHTTPMessageCreateRequest(kCFAllocatorDefault, requestMethod, myUrl, kCFHTTPVersion1_1); CFHTTPMessageSetBody(myRequest, bodyData); CFHTTPMessageSetHeaderFieldValue(myRequest, headerField, value); CFReadStreamRef myReadStream =

CFRelease crash in iOS10

£可爱£侵袭症+ 提交于 2019-12-04 07:02:34
问题 Below is my code, which used to work fine till iOS 9. - (NSData *)encryptWithDataPublicKey:(NSString*)data keyTag:(NSString*)tag { SecKeyRef publicKey = NULL; NSData *publicTag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]]; NSMutableDictionary *queryPublicKey = [[NSMutableDictionary alloc] init]; [queryPublicKey setObject:(__bridge id)kSecClassKey forKey:(__bridge id)kSecClass]; [queryPublicKey setObject:publicTag forKey:(__bridge id)kSecAttrApplicationTag]; [queryPublicKey