I have a defined a custom error domain that I want to publish in a protocol. The domain is defined in the implementation file like this:
//in the .m file
static void *MyErrorDomain = (void *)@"MyErrorDomain";
The .h file implements a protocol, and I would like to publish MyErrorDomain there as well. I can't, however, figure out the co...
I am trying to create a Cocoa wrapper around a Flash application. I've got it loading up in a WebView, and I can control it by sending key events using the CGEvent API, like so:
[myWindow makeFirstResponder:myFlashWidget];
CGEventRef e1 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)keyCode, true);
CGEventPost(kCGSessionEventTap, e1);
CF...
I was looking at the docs for NSTableViewDataSource and they say that this protocol is only available on osx 10.6. How can this be? Isn't NSTableViewDataSource the object that contains all the data for your NsTableView?
...
I have a Core Data model where I have an entity A, which is an abstract. Entities B, C, and D inherit from entity A. There are several properties defined in entity A which are used by B, C, and D.
I would like to leverage this inheritance in my model code. In addition to properties, I am wondering if I can add methods to entity A, which...
I'm working through Cocoa smoothly, but this problem seems so basic it cancels out all the cool stuff I learned. :/
I have a generated file path, and it needs to be in NSURL format. From research, this is the code I wrote:
NSLog(@"Old path = %@", pathToFile);
NSURL *xmlURL = [[[NSURL alloc] init] fileURLWithPath:pathToFile];
NSLog(@"Ne...
I am trying to setup an NSTableView programatically (I really need to avoid using IB) and all the examples I find explain how to do this using the interface building. I have created a controller class that implements the methods tableView:objectValueForTableColumn:row: and numberOfRowsInTableView: but they never get called.
After I set ...
Is there any difference between a CGRect and an NSRect? In particular, I'm wondering about the position of the origin. Are there any important differences I need to know about?
...
I am trying to debug a very nefarious problem with some iPhone Core Data code.
The setup is this: I have a thread which exists to poll a web service and send its results via NSNotification to the main thread (passed in the userDict, a bunch of strings and NSNumbers). I'm using Tim Hatcher's notification library to pass to the main threa...
I am about to create a Cocoa app and I want to ensure that one day I can easily port it to the iPad or even the iPhone. How can I plan for this in advance?
I know I will have to redo all NIBs and probably design a different workflow.
But what about the code? Just replacing every NSsomething with UIsomething won't cut it, right? Any ti...
I have an NSString with a number of sentences, and I'd like to split it into an NSArray of sentences. Has anybody solved this problem before? I found enumerateSubstringsInRange:options:usingBlock: which is able to do it, but it looks like it isn't available on the iPhone (Snow Leopard only). I thought about splitting the string based on ...
Apple has extremely comprehensive documentation, but I can't find any documentation for the function AbsoluteToNanoseconds? I was to find the difference between AbsoluteToNanoseconds and AbsoluteToDuration.
Note
I am beginning to think that the Apple Docs only cover Objective-C functions? Is this the case?
I found the following by usi...
How can I know when an NSTextField has rec'd focus?
Is there a delegate method that will tell me when the user has clicked the mouse in (or otherwise selected) my NSTextField?
thanks
tom
...
Hi ,
I am developing an application in cocoa which uses some java classes .I need to set the app point to
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
instead of:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK.
Is it possible to do this..
Thanks in advance
...
Hi everyone,
How would I go about locking a screen like Keychain does, meaning preventing all access to Dock, menubar, desktop, etc. Basically just a black screen that I can add a password field to, for the user to return to the desktop? I am well aware of the Carbon method, but I want the NSApplication method because this is an all ...
I used PackageMaker(3.0.3) to package a App and add Package version to my app , but when I used Finder to view the info and I didn't find the version info , and When I used packagemaker(2) in the Tiger I can add the package version and view it in the Finder?
...
Hello,
I am using NSDictionary as an associated array (i.e, the keys i am using can be any arbitrary objects). One of the very annoying thing about NSDictionary is that it always make a copy of the key and store it. In my scenario, I will later retrieve the keys from the NSDictionary and do some operations with them. The operation happe...
My sister is a totally internet radio freak. She listens to internet radio all the time. So I thought why not write a little funny styled app for her upcoming birthday ;-)
I'd like to understand the concept behind streaming online web radio. As I never listened to online radio myself I need some advice from you guys.
Questions in my m...
Before reinventing the wheel, I'd better check out if there are solutions I can buy or get for free?
I want to make a little web radio streaming app for my sister. Maybe there's a library that can play streams from the web?
...
Is it possible to instalize an NSRunLoop with needing to load any Nib files ie. without needing to call: NSApplicationMain();
Thanks
...
Hi All,
I am listening for Directory and disk changes in a COCOA project using FSEvents. I need to get events when a root folder is renamed or deleted. So, I passed kFSEventStreamCreateFlagWatchRoot while creating the FSEventStream.But even if I delete or rename the root folder I am not getting corresponding FSEventStreamEventFlags. Any...