Send actions from NSView as with NSButton

I'm making a slideshow application in which I want to be able to click the view displaying the slideshow in order to pause or play it. I was hoping that just like with a button, I can send an action to my ViewController and thereby call a function th

Make a SOAP request with Objective C

I'm trying to make a query to the National Rail Enquiries system using SOAP, using Objective C. Unfortunately, I'm not getting very far with it. I've tried a few things, and all that happens is that I get an empty set of results back. National Rail,

Stop / Pause fast application for the period of time

My app uses multiple threads of NSTimer Object. Within the one function (called randomly at random times, not a fixed delay) I want it to pause the whole app, pause the threads for 1 second only. I have the following code: [self performSelector:@sele

Reading basic data as objects

I have 1 entity in my database "Message" with the values MessageID, messageText and i want to read every row of Core Data, make an object of my class "Message" and put the new object into an array. It's the first time I'm using Core Da

Number of a specific weekday between two NSDates

How can I find the count of a specific weekday occurring between two NSDates? I have searched for quite a while but came up with only solution in which number of total weekdays have been counted, not only the one specific week day.The idea of the fol

Cocoa Websocket Server on Mac OS X

I'm porting my application from Windows to Mac using XCode. One thing my application does is it runs a WebSocket server for communication. I've seen many WebSocket client libraries on github, but I'm having trouble finding one that handles server com

How can I make the table view unmodifiable in Cocoa?

I dragged a Table View from the library, and linked the datasource and delegate, it worked. But when the Application is running, I can double click the row in the table, and actually put some words in it. I just want it to be non-editable. What shoul

Objective-C Creating dynamic objects

After parsing a XML File,i want to create dynamic objects like textbox and buttons based on the contents of xml. I have parsed my xml and retrieved the data. I have created a seperate class for XMLParser and made the call in my vieDidload method. Is

Cocoa - Reference a key in NSDictionary

I want to referenciate a ket and not what it contains on a NSDictionary like this: key { 14819 = { contactDetails = { dictionary = { interests = { Movies = ... I want to make something like this: if([key isEqualToString:@"14819"]){ do something

Xcode 4.4 removed Icon Composer in development tools

So I just upgraded to the latest and greatest Xcode 4.4 but can't find Icon Composer. It was in the Open Developer Tool menu item in Xcode 4.3 but now I can't find it anywhere. Did Apple forget to include it? How do I create icons without it? I also

Determine the location of a long-term gesture recognition tool

Currently I have Long Pres Gesture Recognizers on four different TableViews (two in each storyboard scene, therefore two storyboard scenes). I create these LPGR's with the following code in my ViewDidLoad method... //Add Long Press Gesture Reconizer

flexible alternative to NSTokenField?

I am trying to customize an NSTokenField and after trying several hours I realized that NSTokenField is not customizable enough (at least using public methods). Do you know an alternative to NSTokenField which can be easily customized? Thanks!How abo

Where are NSUserDefaults data stored in a Mac application?

I am using NSUserDefaults to store some data in my application. NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs setObject:@"dummy string" forKey:@"lastValue"]; [prefs synchronize]; For testing purposes I need to s

Cocoa: Accessibility (VoiceOver) for image-only buttons

I use NSButton with empty title and image on it, and it cannot be accessed with VoiceOver. But when I'm setting title (VoiceOver seems to use title), NSButton tries to show it. I think there should be an easy way to not display title, or to set butto

KVO and NSMutableArray

how can I set KVO with an NSMutableArray? I want to be notified when a change appears in the array. I never used KVO before with a collection like an array.I think you'll be interested in the answers to this question. The key is that you can't observ

NSLog on the .mm file

How do I print out something to the debugger console if the file is of .mm extension? I tried NSLog and printf but none shows anything on the debugger console.NSLog works just fine in .mm files, as well as printf. Even std::cout << "foo";

Manage memory with NSString objects

Here is what i have in my main method: int main (int argc, const char * argv[]) { NSString *string=[[NSString alloc]init]; NSLog(@"%@ The retain count is:%d", string, [string retainCount]); NSLog(@"Hello, World!"); return 0; } The outp

fork in the Cocoa application

My problem is not the best scenario for fork(). However, this is the best func I can get. I am working on a Firefox plugin on Mac OSX. To make it robust, I need to create a new process to run my plugin. The problem is, when I forked a new process, mu

Suggestion for dragster / dropzone as dock menu

I'd like to create a dragster/dropzone like dock menu. Looks a bit like a stack with a nsview in it. After a lot if documentation searching and googling I've found a way to determine a dock icon's location. (

Cocoa WebView SWF

I am trying to load an SWF inside a WebView in my cococa app, it works fine when I load an HTML which references the SWF. But i'd like do load the flash file alone, with no HTML. Is that possible??Yes. It's broken in currently-released WebKit (even o

How can I package support files in a Cocoa application?

I'm building an application where I want to provide the user with a few dozen templates that will internally take the form of property lists. I would also want to group them in categories, which would conveniently be achieved using folders. While I h

Avoiding, Finding and Removing Memory Leaks in Cocoa

Memory (and resource) leaks happen. How do you make sure they don't? What tips & techniques would you suggest to help avoid creating memory leaks in first place? Once you have an application that is leaking how do you track down the source of leaks?