I'm attempting to bind an NSColorWell to the NSTextField value and implementing an NSFormatter subclass. The NSColorWell is bound to an ivar in the app delegate which is also bound to the NSTextField. There is an NSFormatter that converts the [NSColorWell color] to a descriptive string.
When the UI focus is on the NSTextField, it does...
In a Cocoa application, I'm looking for a solution to retrieve album artwork from iTunes without requiring iTunes itself to be launched and running in the background.
The usual and perhaps only solution, Scripting Bridge, and inherently AppleScript, will launch iTunes prior to executing any commands.
Album artwork is the only informati...
I'd like to call (void)setDoubleValue:(double)value using performSelectorOnMainThread:.
What I thought would work is:
NSNumber *progress = [NSNumber numberWithDouble:50.0];
[progressIndicator performSelectorOnMainThread:@selector(setDoubleValue:)
withObject:progress
w...
I'm migrating Cocoa-Java code to Cocoa + JNI since Cocoa-Java is deprecated. The code prints an image stored in a file. The new Cocoa code is basically:
NSImage *image = [[NSImage alloc] initWithContentsOfFile:spoolFile];
if ( [image isValid] ) {
NSImageView *view = [[NSImageView alloc] init];
[view setImage:image];
[view ...
I've got a generalization in my core data model with entities named A, B, C let's say where A is a super class with subentities B and C.
A is not abstract, so if I create an A NSManagedObject, I need to create and relate a single B or C subclass object. How do I make this happen? I can create the entities, but HOW do I tell the model ...
I am using this code to rotate a needle (like in a speedometer):
CALayer* layer = someView.layer;
CABasicAnimation* animation;
animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat:0.0 * M_PI];
animation.toValue = [NSNumber numberWithFloat:1.0 * M_PI];
animation.dura...
Hi,
I'm not asking how to do this, it's more in line of "What would you call this?".
I have an NSTableView with several custom cells. I want the table to scroll row by row, meaning that when I move the scrollbar up I want the top row to disappear and when I move it down I want the bottom row also to disappear - I don't want to see half...
I want to remove an animation (CABasicAnimation) before it has completed.
For example:
In my code, I start a needle animating from a rotation value of 0 to a target value of 5. How do I stop the animation when the needle reaches a rotation value of 3?
CALayer* layer = someView.layer;
CABasicAnimation* animation;
animation = [CABasicA...
I'm writing a Cocoa application in Objective-C, and I would like to be able to incorporate Markdown. The user will enter text in Markdown syntax, click an "export" button, and the program will output a file of XHTML.
It seems like there are a lot of options, though. I could use one of the C/C++ implementations, I could run the Perl scri...
I'm writing a wizard with template categories and I'm contemplating using an nsoutlineview to present the user with a hierarchical list of possible templates.
However I can't seem to find a way to automatically recursively expand all of my NSOutlineView's items. I tried
[templatesOutline expandItem:nil expandChildren:YES];
... but t...
Hi,
I have created a minimal OS X boot stick (basically the Snow Leopard DVD with all the packages and installer stripped out). I've written a basic Cocoa app launcher to launch other apps that I put in the Applications folder (the minimal install lacks Dock and Finder).
When I try to launch an app I get this error:
LSOpenFromURLSpec(...
hi guys
I am developing an app which has a text field box. so when i am entering text, it should search the database and give me suggestions just like google search. like if i have entered letter 'a', it should have a box like thing below text field with all names starting with letter 'a'. then if i have entered letter 'b', it should re...
I've created a subclass of NSBox to implement drag and drop. I have the following code:
@interface DropView : NSBox {
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
@end
@implementation DropView
- (void)awakeFromNib
{
[self registerForDraggedTypes:
[NSA...
Hey all,
Do any one of you know how to increase the brightness of the apple logo in cooca? I think it would be cool if my app could control that. Although you could increase the brightness of your screen that is not what I want, but what I want is just to increase the apple logo.
Best Regards,
Kevin
...
I need a little help about KVC.
Few words about the operating context:
1) The iPhone connects (client) to a webService to get an object,
2) I'm using JSON to transfer data,
3) If the client has exactly the same object mapping I can iterate through the NSDictionary from JSON to store the data in the permanent store (coreData).
To do t...
I've noticed that under MacOS 10.3.9 and 10.4.11, an NSMenuItem's attributed title is aligned with the top of its image. In other words, if the menu item's image is higher than its title, the title floats up to the top of the image.
Under 10.6, an NSMenuItem's attributed title is aligned with the middle of its image. The title is vert...
I'm a Java guy who is familiar with Swing programming and recently just started out with iPhone programming. Boy the learning curve was steep and now I would like to start Cocoa development for desktop apps.
I've been reading on articles and considering buying few cocoa book to advance my learning, still I feel I don't fully get it yet....
I thought I had it with,
void shiftArray(NSMutableArray *mutableArray, NSUInteger shift)
{
for (NSUInteger i = 0; i < [mutableArray count]; i++) {
NSUInteger newIndex = (i + shift) % [mutableArray count];
[mutableArray exchangeObjectAtIndex:i withObjectAtIndex:newIndex];
}
}
which turns 0,1,2,3,4 into 0,2,3,4,1 when I shift by o...
The following statement is taken from the CFMutableDictionary Reference section of the Mac OS X Reference Library:
CFMutableDictionary is “toll-free bridged” with its Cocoa Foundation counterpart, NSMutableDictionary. What this means is that the Core Foundation type is interchangeable in function or method calls with the bridged Foun...
In short, I want to create a simple video player which can play some major video formats like quicktime *.mov, for example. What I need is:
video playback (at least the most major formats would be great)
play, pause
need information about where the movie currently is (how many seconds passed, or how much percent)
I'm targeting the ma...