cocoa

How to pass unichar object?

I need to pass a character to the line no. 2: First method I tried, 1) unichar dicttxt = [[myword lowercaseString] characterAtIndex:0]; 2) fileName = [[NSBundle mainBundle] pathForResource:dicttxt ofType: @"txt"]; 2nd Method I tried, NSString *dicttxt = [[myword lowercaseString] characterAtIndex:0]; fileName = [[NSBundle mainBun...

Exception while retriving data from Address Book.

I am getting this exception while retriving data from address book. I have check through internet but not get any help for that. Overflow allocating bitmap backing store. Cannot back bitmap with 320 bytes per row, -2147483648 height, and 1 planes I am using AddressBook Framework for retriving data from Address Book. is this issue o...

How to Convert Gray scaled image to RGB image?

Hi, I am on MAC OSX. How to convert an gray scaled image to the RGB format. Can i use the CIFilters for converting? Or any other way And also i want to reverse the operation. i.e., convert the RGB format to Gray scaled format. Regards, Dhanaraj. ...

How do I determine which path my application is run from?

I'm creating a little program to copy the Domain file for iWeb over to a USB stick or external harddrive or such. The program is meant to be run from that USB stick or external harddrive, and then create a directory where the application is run from. E.g. the application is run from ~/Documents, the application should create a folder at ...

know the position of the finger in the trackpad under Mac OS X

Hello, I am developping an Mac application and I would like to know the position of the finger in the trackpad when there is a touch. Is it something possible and if yes, do you have any idea to achieve this? Thanks in advance for your help, Regards, ...

NSButton raising click event on mouseup

Hello, I am looking for an NSButton raising the click event on mouseup, even if the mouse down has been made outside the button. Do you have any idea to get this behavior? Thanks! ...

how to convert an int to NSString?

I am converting an integer into String. I did a search but here but it is not useful. int i; NSString *str; str = [NSString stringWithFormat:@"%d",i]; [myString appendString:str]; It is not working throwing an error. ...

Touch events, not limited to a specific view

How can I use touch events not limited to a specific view? I want to use those events for an background app and found out that I only can enable touch events for a view by using setAcceptsTouchEvents: Thanks in advance, Philip ...

Xcode debugging problem

I have a little problem with the Xcode Debugger. Looks to me the "Step In" function doesn't work like it should. Or just as I expect it to work. I can step in any method call as long it has no return value: [myObject DoSomething]; That works find but if the method has a return value, there is no Step In. the Debugger just steps over ...

NSApplication endSheet: has no effect

Ok, this is really stumping me: I create a modal sheet on a window as -(IBAction) login: (id) sender { [NSApp beginSheet:loginWindow modalForWindow:window modalDelegate:nil didEndSelector:nil contextInfo:nil]; } and try to remove it with -(IBAction) loginWindowCancelPressed: (id) sender { debugLog(@"cancel")...

What is the best way to display a list using Cocoa?

The iPhone has the UITableView for displaying lists and information, what is the best way to display the same type of lists using Cocoa for an OSX application? I'm trying to convert one of my iPhone apps to the desktop using Cocoa, but having a hard time finding the same type of list view. Thanks for any help in advance! ...

how to set focus on NSMenu (make it get key events)?

I have a status menu with a NSSearchField and menu items. When search field is active and user presses up & down arrows, I'd like to start menu tracking, that is that the user will be able to move with arrow keys between menu items. I can catch moveUp and moveDown selectors. How can I cause the menu to become a key responder? Thanks, N...

Can't run Cocoa UnitTests because of Garbage Collector disabling

I'm trying to add some UnitTests to a bunch of Cocoa Legacy code. I created a Unit Test Bundle, and added all source and frameworks needed, but the build fails with this message: 2010-08-26 16:07:18.074 otest-x86_64[64675:903] The test bundle at /Users/giordano/application/build/Release/UnitTest.octest could not be loaded because its...

Garbage collection eats status item

Hello I turned on garbage collection (objective-c 2.0) and the image for the status item disappeared when I restarted my application.  I am manually memory managing the image and status item.  This application works normal when garbage collection is off.  Is there a way to make the garbage collection not collect specific variables or sho...

How should I wrap a custom NSView in an NSScrollView?

Hey stackoverflow, Cocoa's NSScrollView is horribly under-explained. I hope someone here knows what it's all about and can spare me a few seconds. So I have a custom NSView. I implement -drawRect: for it to draw something, fill itself with colour, whatever. Then I have an NSScrollView wrapping it (set up through the interface Builder)....

NSCFDictionary objectForKey unrecognized selector sent to class

After I call a SOAP webservice asynchronously using WSMethodInvocationSetCallBack and WSMethodInvocationScheduleWithRunLoop I get the result in the following callback function and begin parsing it void wsCallback(WSMethodInvocationRef invocation, void* info, CFDictionaryRef data) { const void *data = CFDictionaryGetValue(resultBody, (NS...

How to raise an event in Objective-C

Hey, I'm a little confused about raising an event in Objective-C, I came from C# (.NET) environment and I would like to learn Objective-c and Cocoa programming. So here's my question: I have a little application with a NSTextField that I want to use to listen to an event. What I want to do : When I double click within this control, ...

import a .xcdatamodel in CoreData CLI

Hi all, i've a little Problem with a CoreData Command Line Tool. I simply created a new Project in XCode (Core Data CLI), created a Data Model in the .xcdatamodel File and auto generated a Header file. Finaly i modified the Code, wich should able to load the Entity. The Program Compiles without errors, but if i run the Program i get th...

Why is my window disappearing ?

I'm writing a program in objective-c but when I build and go the window is not loading. I can click on the .xib file and tweak the interface but when I run the program the GUI is not loading. Any ideas on why this is happening. NOTE: I do see a menu bar that shows that my application is running but the GUI is not visible. ...

Controlling what gets pasted into NSTableView

A user selects a song in my mp3 player. He proceeds to rename a song (thus highlighting the "name" column of that given song). Let's say he pastes in "The\nGreat\nSong". By default, if the string formatter doesn't allow newlines (which is what I want), the app will produce a beep. How can I process the string before it is pasted? This ...