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

Nested optimization should never be triggered. This is probably due to autolayout work happening inside an NSISVariable delegate callback

App crashed and log gave me this message: “Nested optimization should never be triggered. This is probably due to autolayout work happening inside an NSISVariable delegate callback, which is not allowed.” How to fix this?

how to get the volume name (label) by using a local url?

I have looked at NSWorkSpace and NSFileManager but I can’t find out the methods that I’m looking for. I have a saved url (getting from NSSavePanel). ie. this url can be /Users/Josh/Some Folders/file.txt or /Volumes/My USB Key Name/file.txt So can I use this url to find out the displayed volume name? [[NSWorkspace sharedWorkspace] mountedLocalVolumePaths] can […]

How do I fix my application from leaking when using Qt 4.5?

Without any changes to my code except building against Qt 4.5 I get the following warning message when I run my application: *** _NSAutoreleaseNoPool(): Object 0x50a1b0 of class NSCFNumber autoreleased with no pool in place – just leaking I am not using any Objective-C in my code but Qt 4.5 is using a new Cocoa […]

Objective-C Split an array into two separate arrays based on even/odd indexes

I have an array, NSMutableArray *stringArray that looks like this stringArray = [0]String1 [1]String2 [2]String3 [3]String4 [4]String5 [5]String6 How would I go about splitting this array into two arrays based on even/odd indexes? Example: NSMutableArray *oddArray = ([1], [3], [5]); NSMutableArray *evenArray = ([0], [2], [4]); Thanks in advance!

using a UILocalNotification to play a sound that's not in the app bundle

Is it possible to use a UILocalNotification (or any outside notification/long-term multitasking) to play a sound outside an app that’s NOT in the main application bundle? Documentation for UILocalNotification says the soundName attribute must be the name of a file in the main bundle. I threw together a quick app that confirms this. Is there […]

floor double by decimal place

i want to floor a double by its decimal place with variable decimal length (in iphone sdk). here some examples to show you what i mean NSLog(@”%f”,[self floorMyNumber:34.52462 toPlace:2); // should return 34.52 NSLog(@”%f”,[self floorMyNumber:34.52662 toPlace:2); // should return 34.52 NSLog(@”%f”,[self floorMyNumber:34.52432 toPlace:3); // should return 34.524 NSLog(@”%f”,[self floorMyNumber:34.52462 toPlace:3); // should return 34.524 NSLog(@”%f”,[self […]

Objective-C: When to know that you are abusing the SIngleton method of Global Variables

So my clients iphone app has balloned from 5 or so classes to over 25 in the last few weeks. With such a large (for the iphone anyway) class structure I’ve been utilizing the Singleton class for accessing global variables. The problem is that whenever I need to access a variable outside of the class […]

Duplicate symbol _OBJC_CLASS_$_Facebook

I’m building an ARC iphone app, and about to integrate the addThis ios library. I get the following error: ld: duplicate symbol _OBJC_CLASS_$_Facebook in /Users/mars/Desktop/Pst/trunk/Pst/ThirdPartyLibs/FBConnect/FacebookSDK/FacebookSDK.framework/FacebookSDK(Facebook.o) and /Users/mars/Library/Developer/Xcode/DerivedData/Pst-bqmphjiqldalzsankfvxugsurcdj/Build/Intermediates/ for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) I’ve double checked with my Compile Resource, and only 1 facebook.m […]

Why is NSPopUpButtonCell showing correctly when only setObjectValue:nil is called?

An NSTableView has multiples NSCells (indirectly via NSTableColumn). NSCell follows the Flyweight design pattern; they’re cookie-cutters. There’s one cell per column and it’s asked to draw itself for each row. “Here’s a value, draw it on the first row; here’s the value for the second row, etc.” This is in contrast to view-based tableviews which […]

HTTP/2 Server Push in iOS 10

I am trying to get server push working on iOS 10. I am working off of the Akamai HTTP/2 demo. The following is my attempt at testing server push. @interface ViewController () <NSURLSessionTaskDelegate> @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self […]