cocoa

Search text in html files - iPhone App

Hi I am making an iPhone app for an ebook with ebook data in html files. I have to implement search text functionality for ebook data, book size is fairly large. Can somebody please suggest me recommended practice for searching text in large html files - keeping in view performance and other constraints in iPhone. Thanks. ...

How to profile an app that uses IPC

I have implemented part of activity monitor using NSTAsk and NSPipe. This is very slow. Is there any other method to implement it ? And also tell me how to get samples of prcesses. ...

How can I easily redirect the console output in a NSTextView?

Suppose you have the code of a Cocoa app which logs its own messages through NSlogs and printfs to the Console output. My goal is to redirect all this output into a separate NSWindow in a NSView. How can I achieve this in a way that minimizes the amount of code to rewrite makes it possible to revert back maximizes the reuse of written...

Is there any iOS implementation of the Bayeux protocol (COMET, server push to client)?

Is there any library with implementation of the Bayeux protocol, for use in iOS (iPhone/iPad) development, for the building Server push technology iPhone client? And what are your suggestion for doing this? ...

Objective-C Category Causing unrecognized selector

My project has a UIImage category function that I want to call from another class. I properly import the header file for the image category and I get the project to compile with no warning. The problem is that when I call the uiimage category function I seen an unrecognized selector error with a NSInvalidArgumentException. Why am I seei...

OS X / iOS: Labeling phrases in a text view

I want to build an app for the Mac / iPad that allows to assign semantic roles to sub phrases of every sentence of a text. So basically I have a text with n sentences and for every sentence the user selects one or multiple words and assigns it a semantic role (e.g. agent or patient). Then, I want the according phrases to be highlighted i...

How do I store an NSRange in a NSMutableArray or other container?

Here's what I want to do: NSRange r = NSMakeRange(0,5); id a = [NSMutableArray a]; [a addObject: r]; // but NSRange is not a NSObject * With a boolean, I'd use code like this: [a addObject: [NSNumber numberWithBool: YES]]; or with an integer: [a addObject: [NSNumber numberWithInteger: 3]]; So what's the equivalent with a NSRange...

Cocoa Single View question

Is there a way to have a single full-screen picture load when the cocoa app is launched? What I mean by that is a full-screen picture, without the menus and stuff that cocoa automatically attaches to apps.( For example, I want to build an app that when the user clicks it - it brings up a picture of say, a zombie, completely full screen ...

CoreData: multiple copies of the same item linked to another?

In Core Data is there a way to have one instance of an object to have multiple links to another? This is best understood with an example. You have a shopping cart object, ShoppingCart, and you have books, Book. How do you properly put multiple copies of the same book into the cart? No matter how many times you run [shoppingCart addBooks...

Package command line tool with Cocoa app?

Disclaimer: Cocoa newbie here. I wrote an app with a Cocoa GUI that acts as a wrapper for a command line tool. The problem is the tool does not come standard with OS X. Thus, you have to install the command line tool first before using the Cocoa app, or else the app won't function. Can anyone point me to some documentation (hopefu...

Converting .gif to .png format in Cocoa (OSX) without using representationUsingType:properties:

I need to write a method that takes a .gif image file as input and converts it to a 32x32 .png file. The only way I found to do this in Cocoa would be using the representationUsingType:properties: method of NsBitmapImageRep but unfortunatley I cannot use this method because it is not supported by cocotron (an open source API that implem...

Missing keyUp events on meaningful key combinations (e.g. "Select till beginning of line")

I have an NSTextField which uses as an extended NSTextFieldCell, which creates a custom field editor, that intercepts and records key events. (Knowing the key events is important for the application, but the text field is still supposed to work as usual, by calling the [super ...] method). This is what the official documentation suggests...

Application loses focus hide window

Ive been attempting to hide my applications main window when the application loses focus. Upon testing - (void)applicationDidResignActive:(NSNotification *)aNotification { [window orderOut:self]; _isShown = NO; } however this only seems to work once, after I bring my window back with [window makeKeyAndOrderFront:self]; [window...

I'm getting Failed with exit code 1 error in xcode

This is my first ever attempt at a Objective-c cocoa program, so I have no clue why it is giving me that error. I really don't understand the Build Result page either. myClass.h #import <Cocoa/Cocoa.h> @interface myClass : NSObject { int a; int b; } -(void) setvara:(int)x; -(void) setvarb:(int)y; -(int) add; @end myClass....

Binding to array controller in another nib for inspector window

Binding a popup menu to an array controller with the path selection.type works fine. Binding a popup menu to a document controller with the path currentDocument.arrayController.selection.type works one way only (changes in selection are not propagated to the popup menu). How can one achieve inspector-window-like functionality by bindi...

Recommend books for Mac desktop application development

I want to develop desktop applications for Mac, so could you please recommend me whats the best way to learn it like some ebooks or videos.... ...

Drawing class to allow layer control

Hi, I would like to implement a drawing class with the help of Quartz. I want to be able to save parts of what is drawn on separate layers. I want these layers to be retrievable, so I can delete/hide/show layers on command. Can I save multiple CGLayerRef as a NSMutableArray property of my class and then be able to retrieve them? If yes...

Allow bundles/plugins to add to Cocoa application's supported document extensions?

In a Document-based Cocoa application, handled file extensions are listed in the application's Info.plist file. The application I'm building will require a loadable bundle for each type of file it opens. As such, I'd like the presence of bundles to modify the way my application registers itself as handling certain file types. As an ex...

Send action from NSTextField when on key up instead of return.

I want to show the number of characters left for a new tweet, after a key has been lifted. Currently, this only happens if return is lifted: - (IBAction)updateCharacterCountFromNewTweetField:(id)sender { [newTweetCharacterCount setIntValue:140 - [[sender stringValue] length]]; } This action is connected to an NSTextField (NOT A UITe...

Round corners on a borderless NSWindow.

I'm creating an application and I don't want a title bar: If the title remains the same all the time, does it make sense to show it? For example, if an app doesn’t show the names of documents, or any other assets that it opens, and there is plenty of space at the top around other controls to grab onto if you want to move the window a...