cocoa

I'm trying to build a to-do-list application in Objective C but coming up short.

I'm getting this error: -[NSCFArray insertObject:atIndex:]: attempt to insert nil Here is the .m file: /* IBOutlet NSTextField *textField; IBOutlet NSTabView *tableView; IBOutlet NSButton *button; NSMutableArray *myArray; */ #import "AppController.h" @implementation AppController -(IBAction)addNewItem:(id)sender { myArray...

Key Window for background application

Dear Cocoa Developers, I'm creating a backgrounded cocoa application. The only thing that it's missing is the ability to take text inputs! I'm making the application backgrounded by setting "Application is background only" in the Info.plist But no matter what I do I can't make any window the keyWindow. makeKeyWindow makeKeyAndOrderFr...

Inserting bullets and numbering to text

Using the Cocoa Framework, how can I add bullets and numbering to text? ...

cocoa, mac, is there any tools can inspect the class constructs hierarchy of the window or view on Mac?

as topic, I want see the inner constructs of a special view on Mac, like the class name,and hierarchy , etc. as we know, on Windows, we can use Spy app for this purpose, if any the same feature app can be use on Mac ? thanks for you reply. Regards ...

adding hyper text to text on textview

Hi, How to add hypertext on a text on text view. ...

Automatic CoreData UI Prototyping for Multiple Entities

In developing a few CoreData applications, I've found the automatic UI prototyping extremely useful while experimenting with the CoreData model. By automatic UI prototyping I mean selecting a CoreData entity in XCode and option-dragging it to a window in Interface Builder. This brings up a dialogue box in IB allowing me to select some o...

opening onscreen keyboard

hi, How can i open Keyboard viewer which is inbuilt in all Mac OS X from my application. ...

How to resize WebView according to its content?

Hi all, I want to set simple html contents within a web view and then resize it according to its content. To set simple html contents within web view I used this code and it is working fine: [[myWebView mainFrame] loadHTMLString:webViewContents baseURL:baseURLFramed]; Right now, if content is more than its actual size then it appear...

ObjectiveC Syntax for Specifying Protocol Name in Method Argument

What's the ObjectiveC syntax for specifying a protocol as an argument in a method? Say I have 2 protocols, MyProtocol and MyProtocolCB: @protocol MyProtocolCB <NSObject> - (void) func; @end @protocol MyProtocol <NSObject> - (void) register:(MyProtocolCB*) cb; @end I'm receiving this syntax error: error: expected type-specifier befo...

Different results from array controller and fetch request for relationship with nil value

I'm using a simple NSComparisonPredicate similar to: ("employeeDepartment != %@", department) where employeeDepartment is an optional, one-to-many relationship in Employees, and department is an NSManagedObject of Departments. When applied against the Employees entity, I'm getting different results from an NSArrayController vs an NSFetch...

Carbon Accessibility API - Getting windows information across spaces

I have the following (minor) problem that I want to solve programmatically. Whenever I unplug my secondary monitor from my laptop, every windows get moved to be visible in the now smaller resolution. When I plug my external monitor back in, I need to manually replace the windows to their correct position. I have to do that every morni...

[Cocoa] Leaks reports seemingly unrelated issues

I'm fairly new to Cocoa and Objective-C. Currently I'm developing a fairly basic application to test my knowledge and put some of the stuff I've been reading about into practice. Everything is working, but Leaks reports a number of issues. None of these leaks seems to be directly applicable to code that I've written (I have read and tr...

First item in an NsMenu does not appear to show up (cocoa osx)

I am making my own NSMenu programatically and popping it up when a button is pressed. I create NsMenuItems and add them with the NSMenu method insertItem:atIndex:. For some reason whatever item is at position zero in the menu does not show up. Is this how the menu is supposed to work? ...

Draw shadow under NSImage

Currently I'm drawing an NSImage in a custom NSCell like so: - (void)drawInteriorWithFrame:(NSRect)theCellFrame inView:(NSView *)theControlView { // roundedCornerImage creates a new NSImage with rounded corners, rather than clipping. [[anIcon roundedCornerImage:5] drawInRect:anIconBox fromRect:NSZeroRect operation:NSCompositeSou...

Can I access the Cocoa Accessibility API from with Java on OSX?

I need to write an app which can observe and manipulate the positions of windows on screen, and I've been told that this requires using Cocoa's Accessibility API. Unfortunately I'm a Java programmer, and Objective C scares me ;) Is it possible to access this Cocoa API from within Java? I know that back when Apple cared about Java it m...

Decimal point issue on cocoa app

I there, I'm trying making my first cocoa app, but I'm having problems with float numbers because of the regional settings. If I write on the TextBox the float number 1.2 I only can get the number 1, but If I write on the same TextBox the same float number but this time with the ',' sign instead (1,2) I can get the right float value. H...

How can I release this NSXMLParser without crashing my app?

Below is the @interface for an MREntitiesConverter object I use to strip all html tags from a string using an NSXMLParser. @interface MREntitiesConverter : NSObject { NSMutableString* resultString; NSString* xmlStr; NSData *data; NSXMLParser* xmlParser; } @property (nonatomic, retain) NSMutableString* resultString; - (NS...

How do I turn off bullets in NSSecureTextField?

I have a password dialog that uses NSSecureTextField and I want to include a "Show password" checkbox so I can show the password being typed in clear text. ...

Array from Array with dictionaries

I have an array of dictionaries. I would like to extract an array with all the elements of 1 key of the dictionaries in the original array? Could this be done without enumeration? ...

How to paste text from one app to another using Cocoa?

I have read about NSPasteBoard in the Apple documentation, and how it allows for applications to write into the PasteBoard and allow other applications to read that text and use it. Could someone tell me how to paste text from am application (that sits in the status bar) into a NSTextField that is inside a different application. What ...