cocoa

Make only a few columns of an NSTableView movable

In iTunes, you will see that the first two columns (the first narrow one containing nothing) and the second one containing song name, are not movable. The others are movable. How can I accomplish this with an NSTableView? ...

Core Data Relationships, NSPredicates and the NSFetchedResultsController

This has been driving me nuts all day. I have a weird bug that I think I have narrowed down to an NSPredicate. I have two entities: List and Person. List has a to-many relationship to Person called persons and Person has a to-many relationship to List called lists. I pass to my a tableview controller a List object. I then want that tab...

Change Dialog Box Text With AppleScript?

Simply, is it possible to change a "static text" field in an Apple system dialog box? Specifically I am looking into changing some label text of a password popup. I have tried using AppleScript via GUI scripting: tell application "System Events" try tell window 1 of process "loginwindow" repeat until not (value o...

Sending in values in a NSTextField: objective c

Ok, so I have an NSTextField and an NSSlider. In interface builder, I got the float value from the NSSlider to go into the NSTextField. BUT, I need a button that sends the text from the text field in so I can get the value in my code. That text field can also accept manual input so I cannot just link the NSSlider to my code. This is simi...

Timer causing app to freeze in some situations

Here is the code: - (IBAction) startRecognition:(id)sender { backgroundSoundLevel = [backgroundSoundChange stringValue]; timer = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(timerFired:) userInfo:nil repeats:YES]; } - (void)timerFired:(NSTimer*)theTimer { NSString *charlieSoundVolume = [cha...

Cocoa - How to get Mouse Down Events when mouse isn't Dragging?

Hi all, Cocoa, Mac OS X 10.6. My app (a game) needs to determine if the mouse is down within a view, repeatedly, even if the mouse position doesn't change. The problem: mouseDown will only be called the first time the mouse is pressed and held down. If the mouse is not moved at this point, mouseDragged is not called, and no more mou...

Objective C NSTextField keeps text in box highlighted when command is sent

When I press enter on an NSTextField to send what ever's in the text field, it sends it, but highlights what ever's in the NSTextField. Does anyone know how to make it so that once it sends the command in, it deletes what ever's in the NSTextField? Thanks, Elijah ...

Is there any more Cocoa component library like BWToolkit?

I just downloaded and used BWToolkit and quietly impressed. Nice feature, easy-to-use, stability... Any other recommendable Cocoa library like this? (not only for UI) Please introduce! ...

Encrypt with openssl and decrypt on iPhone with AES 128, ecb mode

Update : found the solution. I will update this question soon with the actual working code and command. A client is encrypting a file server-side with C++, and I need to decrypt it in an iPhone application. My client can crypt and decrypt on his side, and so do I on the iPhone, but we can't decrypt the file encrypted by each other. I...

What is the better way of handling temporary strings?

I have a situation where I need to use some strings temporarily but I've read so many conflicting things that I'm a bit confused as to what the best way to proceed is. I need to assign some strings inside an if structure but use them outside the if structure so they need to be created outside the if, I was thinking something like: NSSt...

How to create a dynamic UIImageView

Hi, I want to create an UIImageView with, for example, "Trend.jgp" for a special case (if-condition). I Tried various ways with CGRectMake but i'm not able to create this picture dynamically to a special place. Furthermore, i can't use the function setimage like it's described in the Developer Documentation. Has anyone got an idea how ...

Using python function callbacks with PyObjC?

I'm trying to use an Objective-C class made in Python to do this but Objective-C can't call the method which calls the python function. Here's the framework code which the Objective-C code: // // scalelib.h // Scalelib Cocoa Framework // // Created by Matthew Mitchell on 04/07/2010. // Copyright 2010 __MyCompanyName__. All rights r...

How to set row height based on its content in table?

Hi all, Generally, table has a fixed row height but according to my requirements I need to set height of each row according to content within it. Can anyone suggest me some solution for it? Thanks, Miraaj ...

how to get count of records and aggregate of values via NSArrayController and cocoa bindings

Hi all, I am trying a simple application using NSArrayController and cocoa bindings. The application contains - a table with only one column, two buttons "+, -" to add and delete records, two text fields to show count of records entered and sum of these records. To allow user to enter numbers only, I have assigned NSNumberFormatter to ...

Add an icon (mac & pc) to a file with Cocoa

I want to add an icon (icns & ico) to a file within my iPhone app and I'm not quite sure where to start looking! So when this file is viewed in Finder or Windows Explorer it will have a custom icon. Can anyone point me in the right direction? ...

Confused about NSCFTimer... what is it?

Could someone tell me what exactly NSCFTimer is? I get it when I ask NSTimer for a timer. My problem is that I'm trying to check if an object (supposedly an NSTimer, note the word "supposedly" which is why I'm checking) is an object of class NSTimer, it doesn't seem to work. Does this "NSCFTimer" in any way... hinder the process? ...

How to clear a text field in Cocoa

I'm trying to make a simple Cocoa application using the newest version of XCode. In interface builder I added NSTextField and NSButton. When I press the button, I want it to clear whatever is in the text field. I made a new class called AppController.h. This is the contents: #import <Foundation/Foundation.h> @interface AppController...

CIColorMap filter error

Trying to use CIColorMap filter, but getting run-time error "[NSImage _feImage]: unrecognized selector sent to instance 0x100163b10" when applying the filter Following in the debugger, I see the RTE happens when the last line (return) of applyColorMap is executed. I know both of the (JPG) files exist (imageIn and the one initialized wi...

What's wrong with this Cocoa code?

I'm trying to make a simple Cocoa application using XCode 3.2.3. In interface builder I added NSTextField and NSButton. When I press the button, I want it to clear whatever is in the text field. I made a new class called AppController.h. This is the contents: #import <Foundation/Foundation.h> @interface AppController : NSObject { ...

Zooming in on CIImage or NSImage?

Hi there. I am taking photos from a webcam in my Cocoa application and I would like to zoom in on the centre of the image I receive. I start by receiving a CIImage and eventually save an NSImage. How would I go about zooming in on either of these objects? I'd appreciate any advice. Thanks, Ricky. ...