iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Xcode 6.1 keeps telling me some PartialInfo.plist couldn't be opened

After I upgraded to Xcode 6.1, it kept throwing this exception when I tried to build my existing application. I tried to remove ‘MyController’ and add back again. But it would throw the same exception with different controller. could not read data from ‘/Users/macbookpro/Library/Developer/Xcode/DerivedData/MyApp- dmhwkhbfbxprhycwjeunwtbbtsxj/Build/Intermediates/MyApp.build/DEV-iphoneos/MyApp.build/MyController- PartialInfo.plist’: The file “MyController-PartialInfo.plist” couldn’t be opened because there is […]

how to open Facebook app from url only if installed

I would like to know how to open up a url link from my website in the facebook and twitter app only if it is installed on the device, if not I would like the page to be opened in the browser. Currently I am using the following links: fb://profile/fbID twitter://user?screen_name=username Currently it works fine […]

Load HTTPS url in a UIWebView

I begin iPhone programming and I have big problem I cant resolve. So, I have a UIWebview, I can load HTTP url without problems : NSString urlAdress; urlAdress = @”http://servername”; NSURL *url = [NSURL URLWithString:urlAdress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; Its work, my page is load in my UIwebView, but when I replace […]

How do I get the tap coordinates on a custom UIButton?

I’m using XCode 4.4 developing for iOS 5 on an iPad and am using the Storyboard layout when creating my custom button. I have the touch event correctly working and logging but now I want to get the x/y coordinates of the tap on my custom button. If possible, I’d like the coordinates to be […]

asm(“trap”) on 64-bit iOS devices

In my homegrown assert macro, I’ve been using asm(“trap”) on iOS devices (or asm(“int3”) on iOS simulators) to break in the debugger. However, in 64-bit builds for devices, I get an “unrecognized instruction mnemonic” for the trap instruction. Is there an equivalent for arm64? (Alternatives like __builtin_trap() or raise(SIGINT) do work, but have some behavior […]

How to turn on VPN from iOS app? (Private APIs OK)

When an iOS Device goes into “sleep mode”, even a configured VPN is, unfortunately, turned off. A customer that wants an app for his iPad has to use VPN for security, so anything must be done through VPN. The app has to synchronize a lot, but the iOS device might turn off the VPN by […]

Unable to use self signed certificate with AFNetworking 2

I put the .cer certificate used by the Apache Server in the Xcode project. When the app tries to talk to the server I get this error in Xcode: Assertion failure in id AFPublicKeyForCertificate(NSData *__strong)(), /Users/../ProjectName/AFNetworking/AFSecurityPolicy.m:52 *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Invalid parameter not satisfying: allowedCertificate’ Here is the code for […]

Using a CIImage from CIColor in a CIFilter: getting empty image

I’m trying to create a CIFilter with blend mode (like overlay or multiply). Relevant code: // Let’s try a filter here // Get the data NSData *imageData = UIImageJPEGRepresentation(image, 0.85); // Create a CI Image CIImage *beginImage = [CIImage imageWithData:imageData]; CIImage *overlay = [CIImage imageWithColor:[CIColor colorWithRed:0.7 green:0.75 blue:0.9 alpha:0.75]]; // Create a context CIContext *context […]

How does class composition work in iOS?

Let’s say I have property A on classA and property B on classB and I want classAB to have both properties A and B. I still don’t understand how to make this all work with composition. I realize this can be done with inheritance, but I want to learn how to do this with composition. […]

Observe CKRecord deletion via CKSubscription does not work

CKSubscription doc says: When a record modification causes a subscription to fire, the server sends push notifications to all devices with that subscription except for the one that made the original change to the record. Let assume I have two devices: device 1 and device 2 logged in from different iCloud accounts. Let assume both […]