I am trying to do a little timer app in Objective-C/Cocoa. I am using the NSDatePicker to be able to set the start value. I managed to change the text color to green, because the whole app will be in green on a HUD panel:
But there is a problem. Whenever I am using the picker to change the value, it highlights it wit a gray color and ...
I want to do some custom drawing in a NSView subclass where should I get started?
...
Could someone explain the kinds of placeholder objects that may appear in the Interface Builder document window?
The kinds of placeholders that I know exist are: File's owner, First Responder and App Delegate
Links:
This thread explains First Responder.
This thread explains the App Delegate.
iPhone Interface Builder and Delegates: An...
I have a Cocoa app that embeds a WebView. I'd like to intercept a keyboard shortcut so that I may perform an action in the WebView.
I do not want to implement a menu item for this action. In fact, ideally I only want this shortcut to apply when the user is in a textarea box in the WebView.
How do I catch the keyboard shortcut so that I...
How could I change the background of each row of a NSTableView?
...
I'm new to Objective-C and Cocoa programming, so in my first sample projects I've always adopted the statement of releasing/autoreleasing all my allocated and copied objects.
But what about local objects allocated inside methods?
Let me write some sample code, here is my object interface:
@interface MySampleObject : NSObject {
NSMe...
Can anyone tell me what the arrow brackets "<…>" in an Obj-C class interface do? Like this… http://snipt.net/robhawkes/cocoa-class-interface
@interface MapMeViewController : UIViewController <CLLocationManagerDelegate, MKReverseGeocoderDelegate, MKMapViewDelegate, UIAlertViewDelegate> {
I've previous programming experience with web la...
I am trying to create a utility that doesn't open a window when executed, and that would be activated from a hot key; I read that currently Cocoa doesn't have a function for that, and that I should use a deprecated Carbon function.
Isn't there really a way to use global hot keys in Cocoa? What should I do: wait for Cocoa to introduce a ...
I am allocating myMDD in main which contains an NSMutableArray instance variable (alloc/init-ed in init). When I add items to the NSMutableArray (frameList) I release after adding. The array and the objects it now contains are released at the bottom of main.
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSA...
Are there any tools that allow to create the necessary files required to add the support for AppleScript in an application?
I am looking for a tool that simplifies the task, possibility one that requires me to just give a description of the involved classes.
...
Hello, what's the correct way to call a method from the Xcode debugger command line ?
For example if I'm inside the sort: method of my class A (using the debugger), how can I call debugSort: method that belongs to class A too ?
( My code is Objective-C btw )
...
I'm trying to figure out how to pass a variable (in my case hostname) to a function i created from a programatically inserted "menu item".
#function
-(void)goToTerminal:(NSString *)hostname {
NSString *s = [NSString stringWithFormat:@"tell application \"Terminal\" to do script \"ssh root@%@\"", hostname];
NSAppleScript *as = [[...
How would I trigger a Method when a row in a Table View is selected?
...
Is there a way to determine whether the active window (not of my process, but a different application) is resizable?
Edit: I would prefer to do this without applescript as it then depends on the application being scriptable.
...
I am trying to interface with a cocoa popup menu from an OpenGL button. The actual button needs to be in OpenGL and I cannot stick an actual Cocoa button in its place but when this button is pressed I would like for a Cocoa menu to popup just like the one that comes up when you press the nspopupbutton. It seems that there is no way to ...
Hi all - I have the following class:
@interface SpWindow : NSWindow <NSCoding> {
BOOL _editMode;
SpBgView *bgView;
} ...
... which I then call archive on. My encode method is as follows:
- (void) encodeWithCoder:(NSCoder *)aCoder {
NSLog(@"encodeWithCoder CALLED FOR SpWindow");
[super encodeWithCoder:aCoder];
NSLog(@"SpWind...
Is there a framework that draws Snow Leopard style popups? For an example of what I am talking about, try right clicking something in the dock. I basically want to be able to give a starting point (where the arrow forms) and then a size and have it do the rest.
In this case it's a menu, though my use would be more of just for drawing a ...
I have a Cocoa app that embeds a WebView. The WebView loads html elements including images. I have the textual links for the images (e.g. "http://www.domain.com/path/image.jpg"), but what I want is the image data itself so I can put it in an NSData object and ship it off to Growl. The WebView must have this data since it has downloaded a...
Hello,
it may pre very simple, but cannot find it:
I have three windows in three separate NIBs in my application. One is opened when a new document is opened, the other two can be opened from the program's window menu.
The problem is: two windows (in them the one that is opened at the beginning) accepts the normal keystroke as for ex...
The documentation for this method says: "Pops up the menu at the specified location." but the pamameters seem to describe a different situations:
item
The menu item to be positioned at the specified location in the view.
location
The location in the view coordinate system to display the menu item.
view
The view to display the menu it...