cocoa

NSArrayController/NSTreeController and Cocoa Views

Hi, i've been reading for a while a little bit of Objective C and Cocoa, and i have to say that although i am thrilled with the overall simplicity of Objective-C, I feel totaly lost regarding Cocoa and especially the MVC design pattern. The Cocoa books I've read, ask the reader to just complete a set of steps for a program to work, with...

NSScrollView Bar not scrolling through NSTableView rows

Hello, I currently have an NSTableView inside an NSScrollView and this gets it's contents from a datasource. However, when the number of contents is larger than the view can hold, using the vertical scroll bar does not affect the contents of the table. Dragging the scroll bar doesn't work Clicking the Up/Down buttons doesn't work Usi...

Why the Observer in NSNotification called twice.... ?

If the class is a custom class, after posting the notification, the selector corresponding to the observer is called twice.. Is there any better solution so that the selector is called only once? ...

SCEvents doesn't work in some methods??

Hi, [Note: The title may be less than accurate, I didn't know how else to phrase it] For some reason NSFileHandle's readInBackground didn't work so I resorted to SCEvents, a Cocoa wrapper around Mac OS X's FSEvents API. I have a separate class called "EventListener" that handles all the SCEvents stuff. It has these methods: - (void)se...

Why are there more files/hardlinks with the same iNode than the reference count shows?

I have recursed a folder on a single volume, and retrieved a list of filenames, reference-counts and inode numbers, using NSFileManager attributesOfItemAtPath and NSDictionary fileSystemFileNumber and objectForKey:NSFileReferenceCount For some reason I am getting results such as a reference count of 10, but a list of many more than 10...

Multiline NSTokenField and the return key

Hi, I have a NSTokenField object with multilines (just resized the control vertically in interface builder). Unfortunately the NSTokenField object does not insert new line when pressing the return key. Any ideas how to make the control insterting a new line when pressing the return key? Do I really have to go the complicated way throu...

How can I generate convenient date ranges based on a given NSDate?

I'm creating a report generator in Cocoa, and I need to produce convenient date ranges such as "Today", "This Week", "This Month", "This Year", etc. Is there a good way to do this? Here is my skeleton thus far: @interface DateRange : NSObject { NSDate startDate; NSDate endDate; } @property (assign) NSDate * startDate; @propert...

Binding IKImageBrowserView's zoom to the size of its parent NSScrollView

I have a vertical NSSplitView containing on one of its sides a NSScrollView with a IKImageBrowserView inside. The IKImageBrowserView shows only one row of thumbnails and only has horizontal scroller (the resizing mask is equal to NSViewWidthSizable). I would like to bind the zoom level of the IKImageBrowserView to the height of any of ...

Persisting items being uploaded via web service to disk

I have a launchd daemon that every so often uploads some data via a web service using NSOperationQueue. I need to be able to persist this data, both so that it can later be re-uploaded in the event of failure, even between sessions (in case of computer shut down, for example). This is not a high load application, it probably receives i...

NSIndexPath incrementing values

I am trying to populate an OutlineView with the contents of a XML file. I'd like to create and manage the values inside a NSIndexPath while cocoa parses the document. NSIndexPath has methods to add and remove indexes, but I need to increment/decrement the values in each index: [0, 0] [0, 1] [0, 2] and so on... how can I do that? ...

Unable to access an enumerated datatype from within another class...

Hoping someone can help me with this as I've done some scratching & searching I'm still overlooking something obvious... I've defined a simple enumerated data type: typedef enum { kLow = -1, kMid, kHigh } MyMode; And made an instance variable of this type in my ClassA: @interface ClassA : UIView { MyMode myMode; } @p...

IP Address? - Cocoa

Hi guys, How would I make a GUI program that displays your Ip address with a click of a button? Please, no difficult explanations, I just started Cocoa not long ago. Thanks, Kevin ...

Cannot pass message (or Call a function) using the outlet of a customized class

When a class is customized, by using its outlet , you cant access its method. Is there any better solution to access the method of a customized class? without posting notification? To be more specific, sometimes when a Controller Class having outlets of other classes, could access the method of the corresponding classes. But the revers...

- (void) processImage:(char *)image; ---char* causes a memory leak?

Hello everyone, in my app I'm trying to process an YUV422 image from a webcam. but I'm getting a huge memory leak. below you can see a sample of simplified code of my app. if I disable the "(m1..." line in the function, there is no leak. (but the images are not being processed). I've tried locks, pools, etc but nothing changed. I'm rela...

Creating a new NSCalendar calendar

I want to be able to convert between the Gregorian and Julian calendars (note: not "julian date") using NSCalendar on the iPhone. How can I subclass NSCalendar to use the Julian calendar? I want to do this without regards for 1582 or 1752 or any given year. ...

NSTableView and NSPopUpButtonCell: How to detect when inline editing stops?

In my application, I use a NSTableView in which I allow inline editing. This inline editing is "buffered", which means that the user has to tab through all fields or press return to "commit" the edit. Pressing escape cancels the edit and reverts values. Up until now, I only needed text fields for inline editing, and I am successfully ab...

Does not using Interface Builder buy me anything?

I'm fairly new to Cocoa. I was talking to my brother, who's put together a few iPhone apps, and I said something about Interface Builder. He said that he doesn't use it - he builds his UIs programmatically. He said that this way, he doesn't have to worry about loading the NIB. I understand that using Interface Builder actually creates in...

GUI wrapper for Perl command line app on OSX

I wrote a Perl application which I run on the terminal using command lines. I created aliases for the various command options in the shell to reduce the typing. Even so, having a GUI to to select the various commands and other arguments would make it easier to run the app. What's a good approach to developing the GUI wrapper on OSX?...

Kill process after launching with AuthorizationExecuteWithPrivileges

If I launched a shell script using AuthorizationExecuteWithPrivileges what would be the easiest way to kill the script and any other processes that it spawned. Thanks ...

Easy way to feed in a decimal number as string into an NSDecimalNumber?

Reading the documentation, I would have to do something ugly like this: NSLocale *usLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]; NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:@"0.00001" locale:usLocale]; But: Isn't there a nicer way of telling that NSDecimalNumber class to look out ...