cocoa

Sending a Message from a iPhone to a Mac.

How would I send a message to an App on my mac (which I develop) from my iPhone via WiFi? This message would then make something happen in the Mac App. This is just a fun app for myself so it doesn't need any security like SSL. ...

NSTask Until Interrupted Command in Cocoa / Objective-C

Hello, I am trying to use NSTask on to run an ASR Multicast Stream, a Ruby Server Script, etc. Basically, I'm trying to run tasks with NSTask that do not finish running until interrupted, but the problem is that I can't get the NSTask to run in the background. So it ends up just running and holding up the rest of my program. Any help? ...

How to draw a highlight around mouse cursor

I'd like to be able to display a quick animated "flash" around the mouse cursor (similar to the effect in some screen-recording applications). What would be a good way to go about this? My current idea is to display a temporary, floating, transparent window window under the mouse position, animate it, then hide it. But I'm wondering if ...

NSString stringWithUTF8String appending error

I'm trying to append a char array to an NSString. When I use the code below, I get this error: * initialization method -initWithCharactersNoCopy:length:freeWhenDone: cannot be sent to an abstract object of class NSCFString: Create a concrete instance! What does this mean and how can it be fixed? NSString *str = [[NSString new] initW...

+(void) or -(void) difference?

Possible Duplicates: Objective-C: Class vs Instance Methods? What do the plus and minus signs mean in Objective C next to a method? I've tried to look around and couldn't come up with a solid answer that really explained my confusion. I've seen a few times and that is a class having a method that has it's "method type" set ...

Creating a view with draggable text elements

Hi all, I am trying to create a view for a kind of brainstorming application like, for example, OmniGraffle, with elements that contain textviews and can be dragged around. (Also, the should be connectable with arrows, but that is not (yet) the problem) I did my homework and searched via google and read books about cocoa, but there see...

Memory Leak with NSFetchedResultsController objectAtIndex

Hello, I have a memory leak while using NSFetchedResultsController objectAtIndex: The stack frame is as follow: 0 CoreFoundation __CFDataAllocate 1 CoreFoundation __CFDataInit 2 CoreData -[NSSQLCore _prepareResultsFromResultSet:usingFetchPlan:withMatchingRows:] 3 CoreData -[NSSQLCore _newRowsForFetchPlan:selectedBy:withArgu...

Parsing XML data with Cocoa

I'm working on an iTunes menu bar controller and I want to get the names of all the songs in the user's library. I have found that there is an xml file called iTunes Library.xml. It holds all the data for iTunes (name, artist, album .ect) I want to be able to access that data to use in my controller. I really have never used xml for an...

Slowing down the playback speed of an audio file.

I'm trying to do is slow down the audio in an audio file I'm playing programmatically using the iPod player in an app. I've read that this is possible now in iOS 4 (supposedly they gave us access to the raw sound data from songs in the iPod library, which makes no sense to me given the DRM situation), and I've looked through the new API...

Creating a "My Documents" browser like in the iPad iWork Apps

Keynote, Numbers, and Pages all have a top level "My Documents" browser where you can create, delete, and select for editing all of the documents you've created so far. I'd like to create a document browser like this for an iPad app, but I am not sure where to start. I've Googled and searched here on Stackoverflow, but I haven't found a...

forcing a view to draw in cocoa

I have a superview and a subview. Both are custom. During the drawRect of the superview, I am trying to add the subview, create an image from the drawn view, and remove the subview. My code works fine when I run it and start with the subview already drawn in the superview. It seems like adding the subview (during the drawRect) doesnt dr...

Cocoa Scripting Bridge to put all song names into an array

Could someone show me some code that puts all the songs names in the user's music library into an array? Then show me how to change song names to artists, albums etc. Thanks! ...

24hr to 12hr time convert, insert character to string

This is sort of a secondary question to my question here but it was suggested split the questions up for a better response. I have individual lines of data like the following that a passed to the function separately. Mon-Wed 930-1700 Thu 900-1700 Fri 930-1700 Mon-Wed 930-1700 Thu 900-1700 Fri 930-1700 Sat 900-1200, Home Lending Sat ...

Cocoa -Adding a menu item programmatically

How can I add a menu item inside a sub menu programmatically? ...

Iterate through an array and add a menu item

How can I make this method loop thought an string array and make a new menu item for each string array element. Also how can i store it all in a sub menu... Heres my method so far... -(void)trackIntoArray{ id iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"]; NSArray *allTrackNames = [iTunes valueForK...

Export/Import NSImage as ICO

Hi everyone, I would like to save and read an ICO file. It doesnt matter if its NSImage or NSBitmapImageRep or anything. It just needs to be done. How could this be accomplished? ...

Allow specific number of NSWindow copies to be visible

I have a button in my application, when you click it it opens a new NSWindow. However, if you keep on clicking it it will open another NSWindow. How can I limit the number of visible windows? ...

NSMutableArray object thinks it is an NSArray :(

So I have a property NSMutableArray *grades. At the only place where I set this property, I am doing this: NSMutableArray *array = [[NSMutableArray alloc] init]; self.grades = array; [array release]; [self.grades addObject:@"20"]; The last statement generates an exception: -[NSCFArray insertObject:atIndex:]: mutating method sent ...

Giving a Boolean property to a controller object in Interface Builder

After I drag a controller object to the document window, how do I give it a Boolean property? ...

Buffering NSOutputStream used as NSInputStream?

I have this consumer class that takes an NSInputStream as argument which will be processed async, and I want to push data that comes from a producer class that requires that it has an NSOutputStream provided as its output source. Now how could I set up a buffering (or transparent) stream that acts as the output stream for the producer, a...