cocoa

Objective-C and NSURL: where am I supposed to declare receivedData?

I have a two classes, a controller called "AppController" and a class called "URLDelegate" that encapsulates the sample NSURL code from Apple's URL Loading System Programming Guide. The guide repeatedly mentions declaring the receivedData instance variable "elsewhere." I assume this means outside of the URLDelagate class, because if I ...

CSV parser with low memory footprint for iPhone

After testing my app with Instruments I realized that the current CSV parser I use has a huge memory footprint. Does anybody have a recommendation for one with a low memory footprint? ...

Are there any tools to speed up Cocoa development?

I noticed that there is much repeated work to do when creating Cocoa source code. For example, if I set an instance variable for an object: NSMutableArray *infoArray; I need add code: @property (retain,nonatomic) NSMutableArray *infoArray; @synthesize infoArray; in - (void)dealloc I also need add: [infoArray release]; ...

Comparison between pointer and integer (cocoa)

Hi, I'm just learning cocoa (coming from C#) but I'm getting a strange error for something that seems really simple... (charsSinceLastUpdate>=36) #import "CSMainController.h" @implementation CSMainController //global vars int *charsSinceLastUpdate = 0; NSString *myString = @"Hello world"; // - (void)applicationDidFinishLaunching:(...

Drawing lines between windows just like in Interface Builder

I have two windows, each with a round NSView: ------------------ ------------ |X-+ Oscillator | |X-+ Mixer | |----------------| |----------| | | | | | O | | O | | | | | | | | | ------------------ ------------ Bo...

Making a circular NSSlide look and behave like in GarageBand

I am new to drawing with Cocoa, and I am making some software which will have sliders similar to these found in GarageBand: These look beautiful and can be controld by moving the mouse up and down. Can you help me with customizing NSSliders by subclassing them, so I can make them look and behave exactly as in GarageBand? Thanks. I...

Pre-release checklist

I built an 10.6+ only app, I tested it in 32-bit and 64-bit mode and everything works (or at least I couldn't find anything wrong). I need help with the actual release build of the app. What settings should I keep an eye out for? Thanks! ...

Fast (de)serialization on iPhone

I'm developing a game/engine for iPhone OS. It's the first time I'm using Objective-C. I made my own binary format for geometry data and for textures I'm focusing on PVRTC. That should be the optimal approach as far as speed and space are concerned. I really want to keep loading time to a minimum and - if possible - be able to save very...

Delete Drag and Drop Behavior of IKImageBrowserView

Hi Everyone: By default (it seems), IKImageBrowserView enables drag and drop to locations in the Finder. I would like to turn off this behavior but am unsure of how to do so. I was thinking that perhaps implementing the NSDraggingDestination protocol and overriding it could solve this, but so far it hasn't worked for me. Thanks for a...

How do I specify the block object / predicate required by NSDictionary's keysOfEntriesPassingTest ?

For learning (not practical -- yet) purposes, I'd like to use the following method on an NSDictionary to give me back a set of keys that have values using a test I've defined. Unfortunately have no idea how to specify the predicate. NSDictionary keysOfEntriesPassingTest: - (NSSet *)keysOfEntriesPassingTest:(BOOL (^)(id key, id obj, BOOL...

NSButton blue highlight

Hi. i want to make on/off gradient NSButton but with blue highlight like NSTabView select buttons. Is it possible to make this easy way? Or i should draw this manually? if i should draw this manually what is the best way to do this? (CIFilter or just NSGradient) thanks. ...

Mono for OS X and Cocoa

I hear there are at least four different Cocoa bindings for Mono. The ones I know about are: Cocoa# (not maintained) Monobjc (http://www.monobjc.net/) NObjective bridge (http://code.google.com/p/nobjective/ mobjc (http://code.google.com/p/mobjc/) MonoMac (http://mjhutchinson.com/journal/2010/06/09/monomac_in_monodevelop) Does anyone ...

How can I run Gcov over an installed Cocoa application?

I have a Cocoa application which uses an installer. I want to be able to run code coverage over the code (after it has been installed). This is not the usual unit-test scenario where a single binary will run a suite of tests. Rather, the tests in question will interact with the UI and the app back-end whilst it is running, so I ideally ...

Concatenating a string with the value of a NSTextField results in odd symbols in Objective-C

I'm in my second day of learning Objective-C, Cocoa and IB. This is probably something really simple but I cannot work it out. Basically, I have a form with a NSTextField, when the user types in this field and clicks an OK button the application will display an alert saying Hello followed by the value of text field. It's all working ap...

Activity monitor doesnt display process name

Hi, I have an application, when I see that application in "Activity Monitor" the applications Process Name is displayed nothing. Only the application icon is displayed. I tried debugging this by getting processInfo of the app, I got the application name correct. Even tried with the "top" command, I got the application name correct. The...

Setting the font of an NSTextView

I am subclassing NSTextView to set it's default font: PTNfoEditField.h @interface PTNfoEditField : NSTextView { } @end PTNfoEditField.m @implementation PTNfoEditField -(id)init { if(self = [super init]) { [[self textStorage] setFont:[NSFont fontWithName:@"Courier" size:10]]; } return self; } @end However, ...

How to reparent a Cocoa window?

I need to host my window upon a window of another application. How to enumerate windows of another Cocoa application? Is it possible to control them? If no: how can I draw upon a window of another application? Thanks! ...

How to save a NSImage as a new file

Hi! How can I save a NSImage as a new file (png, jpg, ...) in a certain directory? Thank you for answering my "noobish" question. ...

MVC design in Cocoa - are all 3 always necessary? Also: naming conventions, where to put Controller

I'm new to MVC although I've read a lot of papers and information on the web. I know it's somewhat ambiguous and there are many different interpretations of MVC patterns.. but the differences seem somewhat minimal My main question is - are M, V, and C always going to be necessary to be doing this right? I haven't seen anyone address t...

Aaron Hillegass Chapter 18 Challenge Question

I am working through Aaron Hillegass' Cocoa Programming for Mac OS X and am doing the challenge for Chapter 18. Basically, the challenge is to write an app that can draw ovals using your mouse, and then additionally, add saving/loading and undo support. I'm trying to think of a good class design for this app that follows MVC. Here's what...