cocoa

NSArray of Dates sort

Consider this array. It has no keys, so I am not sure I can use NSSortDescriptor. What would be the best method to sort them? ( "Thursday, July 30, 2009", "Monday, September 07, 2009", "Wednesday, September 09, 2009", "Friday, August 14, 2009", "Saturday, September 05, 2009", "Monday, August 10, 2009", "Thu...

Finding where a method was called from.

How would I find out where a method was called from? Like you see in a stack trace. Basically, just to explain, I am observing a core data property and the method that gets called when the property changes calls another method (the IBAction) but in this IBAction it adds Core Data objects which triggers the KVO method which triggers the ...

How do I know when an attachment attribute is being added to my NSTextView?

Because of the semantics of certain NSTextView attachments in my application, I want to know when they are inserted or deleted from my text storage. My subclass of NSTextView implements the shouldChangeTextInRange:replacementString: method, which allows me to easily see when an attachment is about to be replaced (I can search the text s...

How to create a Run Loop which is kicked only by performSelector... method calls?

Hey guys! I'm messing around with threads a little bit. Now consider this: I have a main thread. I start a new thread. In it's entry-point method, I want to make a run loop. Now the documentation tells meh that I have to have a input source. Otherwise my run loop exits immediately. bad. okay. but I have no other input source than my perf...

JNA Resources for OS X

I am looking for reading material on using JNA on OS X, there lots of examples on the web for windows but i can't find anything for OS X. I know that the idea is the same but i have zero cocoa experience. So anyone know any simple examples of using JNA to access cocoa functions? ...

How to get OpenGL to display NV12 texture in Cocoa

I have a YUV:420 (aka NV12) frame data, how can I get OpenGL to recognize its format for glTexImage2D() rendering. I realize that I might have to perform colorspace transformation, but is there a way that I can tell openGl to command the graphic hardware to perform the colorspace transformation? ...

How do you enforce the minimum OS requirements in a Cocoa app?

My app needs to run on 10.4 or later. If I launch it on 10.3 it just fails to launch or crashes. How do you tactfully enforce minimum system requirements? Can you customize the message it shows? ...

NSString stringWithString - what's the point?

As NSString strings are immutable, what is the value of the stringWithString: class method? Update - yeah, I get the utility when used with NSMutableString, I just didn't see the utility with the NSString class. Also - I apologize if I wasn't clear enough; I wasn't intending to startup the initWithString vs stringWithString thread. Than...

Getting thread id of current method call

Is there a way to print out the current thread id on which the current method is executing on? (objective-c please) ...

How many controller classes are typical in a cocoa app?

When designing my application how many controllers should I have? Is it good practice to have one controller for the entire app, the entire window, or for each class? Additionally how many objects are to many created in the doc window in Interface Builder. Tutorials generally have one called AppController. Do full applications typica...

Method/IBAction stuck in infinite loop. Still no success.

Now this may sound like my earlier problem/question but I've changed and tried a few things that were answered in my other questions to try to make it work, but I've still got the same problem. I am observing a core data property from within a NSManagedObject sub-class and the method that gets called when the property changes calls anot...

Reading from socket using SmallSockets makes my app crash

Hi, I'm creating an app using the SmallSockets library ( http://smallsockets.sourceforge.net/ ). I have this code: #import "MAController.h" #import "Socket.h" @implementation MAController - (IBAction)doRequest:(id)sender { //Initialize NSURL *uUrl = [[NSURL alloc] initWithString:[tfHost stringValue]]; int ...

webview in core animation layer

I wanted to create a webView inside of a CALayer. Maybe it is too trivial but I am just getting my head into CA. Would anyone please be able to help? cheers Ron ...

Core Data, NSTableColumn bindings and custom NSCell

I'm trying to display an array of NSManagedObjects in a NSTableView using a custom NSCell that is able to draw the managed object properly. For that matter, the single column of my NSTableView is binded to the arrangedObjects of a NSArrayController. I'm not using any key paths on the object. I was under the impression that my NSCell s...

How do you create an alias in Cocoa? Is a symlink good enough?

I couldn't find a convenient way to create an alias, so I went with a symlink. I'm worried that that might not be good enough. Maybe the icon doesn't show on some versions of OS X or something like that. [[NSFileManager defaultManager] createSymbolicLinkAtPath:aliasPath withDestinationPath:destPath error:nil]; Is this sort of thing th...

What's the best way to find if the processor type is PPC or Intel in Cocoa? (Do I have to use Carbon?)

I need to get it as a string to use elsewhere in the program, I'm not worried about compiler settings. I found HowToGetHardwareAndNetworkInfo on CocoaDev, but it seemed a little intense when all I wanted to know is PPC vs. Intel. ...

Strategies for debugging Objective-C Garbage Collection Crash

I have a pretty frustrating crasher that is impacting a small subset of my users. From my analysis it seems to be isolated to PowerPC users running 10.5. When the garbage collector runs in the background, it will silently kill my application. Here's the relevant snippet from the crashlog. Exception Type: EXC_BREAKPOINT (SIGTRAP) ...

send email through a cocoa application

Is there any way I can send an email, like any frameworks or something. I've tried some (pantomime, mailcore) but I can't get them to work. So if you know of any frameworks/other methods, or if you know of a good open source example using either pantomime or mailcore I would greatly appreciate it ...

Implement Itunes like "All" filter in master detail interface

In Itunes, there is an "All" filter in the music browser. The user, e.g., can select "All (350 Artists)" to see music across all artists. I have a Core Data backed Master Detail interface where I have a list of groups as master and a list of items in the group as detail, both NSTableViews. I have connected the 2 views together through...

Trouble setting Request Parameters in MPOAuthConnection

I'm using MPOAuthConnection for Cocoa oauth. I've updated the latest from SVN, built the project and have been playing the example provided. In the example, the method called has no place to set parameters. The WebService API I'm using requires parameters to obtain the data (of course). I've tried modifying the example code directly to s...