cocoa

NSFileManager delete contents of directory

How do you delete all the contents of a directory without deleting the directory itself? I want to basically empty a folder yet leave it (and the permissions) intact. ...

How do I edit a row in NSTableView to allow deleting the data in that row and replacing with new data?

I'm building a to-do-list application and I want to be able to edit the entries in the table and replace them with new entries. I'm close to being able to do what I want but not quit. Here is my code so far: /* IBOutlet NSTextField *textField; IBOutlet NSTabView *tableView; IBOutlet NSButton *button; NSMutableArray *myArray; */ #i...

Finding text's bounding rect in Core Text

I'm trying to find the boundaries of a line of text in Core Text. For simplicity, assume it has a single character. At the moment I'm using the following method: line = CTLineCreateWithAttributedString(attrString); rect = CTLineGetImageBounds(line, context); It works most of the times, but for some characters, like math italic d (Unic...

Cocoa WebView font too small

When I add a WebView to my application the font size of web pages is a lot smaller than that in Safari. Is there some reason? ...

Localization in Mac application

Hi , I'm trying to add localization to my Mac application, with the localized files and xib for the Danish language. When I compile it accepts Danish key entries as expected but after packaging the software it won't accept any other language besides the default "English" language. Please guide me if any one has worked with this problem....

Changing the TimeZone

How to change the time zone from pst8pdt to gmt in cocoa ...

How to achieve Large Type like Address Book?

Within Address Book you can click on a contact's phone number label and select the option 'Large Type' which displays the phone number in large text in what appears to be an HUD window. I saw one other application use this but cannot figure out how to achieve this. What really interests me is how they have the titlebar-less window. th...

Crash in OS X Core Data Utility Tutorial

I'm trying to follow Apple's Core Data utility Tutorial. It was all going nicely, until... The tutorial uses a custom sub-class of NSManagedObject, called 'Run'. Run.h looks like this: #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @interface Run : NSManagedObject { NSInteger processID; } @property (retain) NSDat...

.Net HttpWebRequest/Response Cocoa Equivelant

I am currently trying to port a .Net app to Objective C and Cocoa. I know the basics and have had little trouble with most things. But I'm having trouble retrieving data from the Web. In C# I would use POST and GET to retrieve information from a server as such byte[] buffer = Encoding.ASCII.GetBytes("someData"); HttpWebRequest request...

Printing CALayers

I have a NSView which contains many CALayers. When a user is editing a document, these CALayers animate all edits. I am attempting to implement printing for my app, but I am having some problems printing these CALayers correctly. Some CALayers bounds occupy the entire NSView, and do not need to be laid out, because their position never ...

Does anyone know a Safari style Tab Control for Mac OS X applications?

I am looking for a tab control that is different from the default NSTabControl. I am looking for a sample or existing control that replicates the newer style tab controls that are used within Safari, Firefox, Camino etc. From looking into the Safari app bundle resources it seems the tabs are created from images. I would prefer a contr...

Working with timezones in C

Hi, I'm currently migrating some of my code from Cocoa (Apple's Objective-C API) to C, in order to make it available for other operating systems, such as GNU/Linux. In Cocoa, there were many great things like creating NSTimeZone objects from their string descriptors using timeZoneWithAbbreviation:. This allowed me to use values like "E...

Working with the Objective-C/Cocoa flat namespace

I've not found anything that addresses my specific name space question as yet. I am working on some AudioUnit plug-ins featuring Cocoa based GUIs. The plug-ins use a common library of user interface classes (sliders, buttons etc) which are simply added to each Xcode project. When I recompile and distribute updates it is pretty much gu...

Resizing columns in NSOutlineView without showing headers

Hi, I've an outline view with two columns. I want to allow my users to resize both columns but it doesn't seem to be possible without also displaying the column headers. Anyone succeeded in doing this? ...

Bring NSRunAlertPanel Dialogue to Front in Background Process

If you call NSRunAlertPanel() from a background process in Cocoa, the dialogue does not come to the front and instead stays behind other windows. This post shows that you can bring the dialogue to the front if you convert the process to a foreground process. If you keep the process a background process, however, is there any way to ...

Using a proxy for NSURLConnection

Is there any way to get the content of a webfile (namely a .html Document) using a proxy, which is not defined in the system settings? I know that NSURLConnection is the right way to download a web file into a variable and not into a file (for which we should use NSURLDownload), but I don't find a way to use a proxy for it. Are there som...

NSTableView navigate with arrow keys

How can I navigate through my table view with the arrow keys. Much like setAction: or setDoubleAction, but instead of reacting to clicks, react with the arrow keys moving up or down through the table. ...

Performance considerations when mixing C++ and Objective-C in same file

I have some high-performance C++ that I need to interface with Objective-C, is there any performance penalty to just dumping this code into a .mm file that contains my Objective-C code vs. leaving this code in a separate .cpp file and extern-ing all the functions I need to call from the .mm file? ...

(Not So) Silly Objective-C inheritance problem when using property - GCC Bug?

Update - Many people are insisting I need to declare an iVar for the property. Some are saying not so, as I am using Modern Runtime (64 bit). I can confirm that I have been successfully using @property without iVars for months now. Therefore, I think the 'correct' answer is an explanation as to why on 64bit I suddenly have to explicit...

How can I conditionally color files and folders in the OS X Finder?

I want to color badge files and folders based on the some condition in finder, what is the approach to achieve this in Mac OS X 10.6 I have checked this question: This only talk about the context menu in finder http://stackoverflow.com/questions/1651075/finder-plugin-in-snow-leopard I have even checked: http://scplugin.tigris.org/ even...