cocoa

Sound balance keeps jumping

I'm using AudioHardwareServiceSetPropertyData to set the master volume. I'm using the following: AudioObjectPropertyAddress propertyAOPA; propertyAOPA.mElement = kAudioObjectPropertyElementMaster; propertyAOPA.mScope = kAudioDevicePropertyScopeOutput; The problem I'm facing now is that, the sound volume can be set properly in my app, ...

Creating my own file extension based on plist

Hi My application handles with files of type *.mndl which is not more than a customized *.plist. Up until now I've been using *.plist files but now I want to associate the extension and be able to open *.mndl files from any other app I have realized that renaming file.plist to file.mndl does not work. (Hence, I don't even know if I did...

Can an ABPeoplePickerView instance be used multiple times?

I wrote a simple Mac OS X application to edit the notes of my Mac Address Book contacts. The program looks like this: Single screen: | ABPeoplePickerView on the left side || NSTextField on the right side | I've hooked up notifications so that whenever the selection in the ABPeoplePickerView changes, the text field gets updated and s...

NSManagedObjectContext save causes NSTextField to lose focus

This is a really strange problem I'm seeing in my app. I have an NSTextField bound to an attribute of an NSManagedObject, but whenever the object is saved the textfield loses focus. I'm continuously updating the value of the binding, so this is far from ideal. Has anyone seen anything like this before, and (hopefully) found a solution? ...

Is it possible to bold an NSString?

Is it possible to make an NSString bold? If so, how? I am not using UILabel or UIIextView for some reason. ...

AudioUnit: access ComponentKernel properties from CocoaView

Hi, I would like to access my AudioUnit Component Kernel members from an action method defined in the cocoa view of my AudioUnit Component : - (IBAction)iaParam1Changed:(id)sender { float floatValue = [sender floatValue]; NSAssert(AUParameterSet(mParameterListener, sender, &mParameter[0], (Float32)floatValue, 0) == noErr, @"[MyA...

Shared Cross-Process Data Object

I need an object/class that keeps data synchronous over multiple processes. Like a singleton instance that works across processes. Is there already a built-in class that can handle this or what's the best way to implement such a thing (NSConnection, NSDistributedNotificationCenter, etc... ?) Regards, Erik Update: Currently I have im...

Is it OK for other threads to have indirect access to a managed object context running in a thread of its own?

Apple's recommended method for multithreading core data is to use a managed object context per thread, and to send changes from one context to another by saving the changed thread's context to a shared persistent store. While I can imagine that being fine for, eg. an RSS reader, for some applications it seems far from ideal. In my case,...

What the difference in using async NSURLConnection from a static method with an object as delegate, and calling it IN an object with self as delegate?

When i try to send – initWithRequest:delegate:startImmediately: message to NSURLConnection from a class method, passing an ad-hoc delegate object, delegate methods never gets called. When, instead, – initWithRequest:delegate:startImmediately: is sent by an object, and the delegate of NSURLConnection is self, than all goes OK. Someone can...

What does AudioServicesCreateSystemSoundID do?

What does AudioServicesCreateSystemSoundID do? All I was able to find was this from Apple's site: // Create a system sound object representing the sound file AudioServicesCreateSystemSoundID ( soundFileURLRef, &soundFileObject ); And It isn't very helpful. I always see it created but then never used. ...

Adding secondary text to window title bar in Cocoa?

I was hoping to release my software with a trial period and I was wondering how I could show a link in the right side of my title bar telling them how long their trial will last similar to what Coda does. Anyone have any suggestions? ...

Browser for Mac using WebView

I'm making a really simple Browser for Mac OS X but I've encountered a problem. I sign in to Facebook and select the box "Remember me", but when I restart my app I have to sign in again. At the moment it is just a WebView in the main window and on load I tell it to load http://www.facebook.com So, how I do to make "Remember me" work? ...

NSMetadataQuery end of search

Is there a way to know whether or not the NSMetadataQuery is still gathering metadata (or is still running)? I mean,in my program I set the search scope to a single directory; now, the query is simple so it takes a few time to collect all the data. How can I know if he finished or not? ...

Do work out of process in a cocoa app?

I've got a cocoa app that needs to do some work in a second process (because it might crash due to buggy libraries). I'd like to keep my project as simple as possible, so ideally I would use the same binary as the parent process and just control the child with command line parameters. It would also be nice if the parent could get handl...

QuickLook consumer as a delegate from an NSViewController

I am having some problems implementing QuickLook functionality from a table in an NSView. The limited documentation on QuickLook really doesn't help at all. After reading through the Apple Docs (which are geared heavily towards custom generators and plugins), I ended up looking at the QuickLookDownloader sample code. This code is based ...

Cocoa: Sliding a HUD window from a dock icon

I want to accomplish a specific animated start-up behaviour for a utility application window. When the application starts I want the application window (a HUD window) to slide out from the dock, comparable to the way a drawer slides out of a window. I would appreciate any hints on how to accomplish this, if it is at all possible. ...

Navigation application in mac

hi, i am new to mac development, i have to create an application which will have multiple views/windows like in installation wizard( where few option are selected one after other etc). Can any one provide me a link for any such tutorial or where can i refer them. sample app will be very much appreciated. ...

Cocoa - prevent window from getting overlapped

I'm writing an app that should remain visible on the desktop at all times. As such, I have to prevent other apps' windows moving on top of my app's window. The Dock.app from Mac OS X partially does this: if you resize windows, they won't resize into the Dock.app's screen space, and if you hit the windows' '+' button, the window will not...

How to cut out parts of NSString?

I have a lot of strings looking like this: @"/News/some news text/" @"/News/some other news text/" @"/About/Some about text/" @"/Abcdefg/Some abcdefg text/some more abcdefg text" How do I cut out the first part of the strings, so that I end up with the following strings?: @"/News/" @"/News/" @"/About/" @"/Abcdefg/" tia ...

Return error in NSMutableArray

I'm trying to to return a NSMutableArray but I got this error in the console: 2010-10-01 14:12:21.348 Phonebook[1424:a0f] +[LinkedList getListArray]: unrecognized selector sent to class 0x1000053e8 The method code is: - (id)getListArray { ListNode *tmp = iterator; iterator = head; NSMutableArray * list = [NSMutableArray...