If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I’m new to Cocoa and...
In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what’s the best way to do this without restarting the...
Some code I am unit testing needs to load a resource file. It contains the following line: NSString *path = [[NSBundle mainBundle] pathForResource:@"foo" ofType:@"txt"]; In the app it runs...
An Xcode beginner’s question: It is my first experience with Xcode 4.6.3. I am trying to write a very simple console program, that searches for paired BT devices and...
This question already has answers here: Closed 9 years ago. Possible Duplicate: Best practices for validating email address in Objective-C on iOS 2.0? I am developing an iPhone application...
I have a UIImage (Cocoa Touch). From that, I’m happy to get a CGImage or anything else you’d like that’s available. I’d like to write this function: - (int)getRGBAFromImage:(UIImage...
I have an iOS project using CocoaPods. Everything was working smoothly until another developer started to work on the same project. He made some changes (only to code as...
How can I execute a terminal command (like grep) from my Objective-C Cocoa application? 12 Answers 12
Maybe this is obvious, but I don’t know how to declare class properties in Objective-C. I need to cache per-class a dictionary and wonder how put it in the...
I’m writing a plug-in for a piece of software that takes a big collection of items and pops them into HTML in a WebView in Cocoa (which uses WebKit...