cocoa

Easiest way to run shell script objective-c

Hello, I am a objective-c newbe and am wondering how to run a shell script in objective-c easiest way possible. I don't care about any of the output. I have tried system(), exec() and execl() and an NSTask. Those methods don't work for some reason... This is the shell script I am trying to run: "mount_webdav http://idisk.mac.com/idi...

Objective C Printing: How to set header content?

Hi there, I want to print a specific NSView. When I do this, I wish to add content to the header of the print page. e.g. If the NSView contains a picture of a cat, when I press print, print preview shows up with the picture of the cat. I want the print out to be a picture of a cat, with the caption: "Cat" in the header, which I do not...

Is it wrong to use int in Cocoa and CocoaTouch?

What is the advantage of using something like NSInteger instead of int in code? I see this in examples a lot, including Apple's official code samples. ...

How to add a program into Dashboard and implement to turn over a panel In Mac?

I found some programs can put into the Dashboard , and most of them have a feature: when click the "i", the panel will turn over and show another panel , How to implement it ? and how to put a program into a Dashboard? Thank you very much! ...

Mac OSX Overlay

How would I go about programming a HUD type overlay in OSX. I want to be able to have an application that will display text at a certain point over a different application's window. And thus if the (other applications) window moves the HUD part will stay at the same coordinate of the other window. ...

Objective-C NSURL URLWithString appears to fail when using variable

So this is my first posting on StackOverflow, so excuse me if my request is not well formed. I am attempting to load a variable with type NSString into an NSURL with the following line: audioPlayer = [[AudioPlayer alloc] initPlayerWithURL:[NSURL URLWithString:aArchiveItem.streamURL] delegate:self]; And in AudioPlayer implementation I...

NSArray initialization with numbers

I was wondering how do I go about creating an NSArray with say numbers 1-100 to be used in a UIPickerView. I know from other programming classes I could do: int array[100]; for (int i=1, i<=100, i++) array[i]=i; But I am not sure how to something equivalent with NSArray, instead of manually typing in all the values. I searched it...

OSX: number of buttons on attached mouse

I would like to offer tutorial text that changes depending on the number of mouse buttons available. For example, if there are two mouse buttons the text would say "Right click" whereas if there's only 1 button the text would say "Ctrl+click". Is there any API in Cocoa or Carbon that can identify the number of available buttons on the ...

Display data from NSArray in NSTableView

Hi all, I have a problem, and I reckon there's a really straightforward solution to it, but I can't fathom it out! I have this piece of code: NSManagedObjectContext * context = [[NSApp delegate] managedObjectContext]; NSManagedObjectModel * model = [[NSApp delegate] managedObjectModel]; NSDictionary * entities ...

Fading out a Cocoa window

Hello I am wondering if there is a way to animate a window in objective-c using core-animation or quartz. I would like to fade out a window when I close it. My OSX operating system is Tiger. Edit: Is it possible to do the same with an applescript application in Xcode by somehow calling a method from objective-c or another way? ...

How can I run a shell command from my cocoa app?

I want to run a simple command from my cocoa app through code, NOT creating a shell script and running it that way, but by running it through the application, being able to define everything and change it on the fly ...

Property Refuses to Synthesize

I've been going through the screencasts here to learn how to write a table-based iPhone application, and it's been going pretty smoothly so far. Presently I'm halfway through the third episode, and it's starting to hit a snag. In order to remove temporary hard-coding for the top layer of the table, the tutorial creates an NSMutableDici...

Cocoa: create drop zone for files

I want to create a drag and drop zone (using an NSView) for ANY file in my cocoa app. How do I do it? ...

dynamic libraries in XCode

I am trying to create an mac application in XCode that has some of its implementation in a dynamic library. I added a new target (dynamic library) to my XCode cocoa project and after a bit of fighting with frameworks and precompiled headers, have the dynlib compiling - and running successfully from the debugger. When run standalone how...

How do I pause my app until a crash report has been submitted?

Background I'm using UKCrashReporter in my app. I've installed my own Uncaught Exception Handler. I'm setting up the managedObjectContext of the object activeItemController in applicationDidFinishLaunching (1) The Problem If the managedObjectContext method throws an exception, the crash reporter dialog box only flashes up before th...

Can Core Data content be edited directly?

I've been using Core Data for about a week now, and really loving it, but one minor issue is that setting default values requires going through and setting up a temp interface to load the data, which I then do away with once I have the data seeded. Is there any way to edit values in a table, like how you can use phpMyAdmin to manipulate...

NSManagedObject subclasses and setValuesForKeysWithDictionary:

I am initializing a NSManagedObject subclass using: - (void)setValuesForKeysWithDictionary:(NSDictionary *)keyedValues I am also knowingly giving it the undefined keys, which of course should through an exception. So, I have implemented: - (void)setValue:(id)value forUndefinedKey:(NSString *)key If a key is undefined, I map it to ...

Horizontal NSTableView (i.e. entity data per column vs. standard entity data per row)

I am trying to create a Mac OS X Cocoa based application with data displayed in a tabular format, but the data needs be displayed vertically in one column per entity instead of the standard NSTableView one row per entity functionality. Is there an appropriate Cocoa class for this? Essentially I'm looking for a "horizontal" table of NSCo...

Sharing a single cocoa framework copy across plugins

I have a set of plugins, a plugin framework for common code and a host app. These are each in separate Xcode projects (including separate projects for each plugin). In the end, I need to be able to click build and run on the host app project to build all the plugins, the framework and host app, package them up and launch the app. I kno...

Compare NSString accounting for articles (i.e. "the" and "a")

I thought caseinsensitiveLocalizedCompare: would take care of this (that is not including "the" and "a" in the comparison) , but it does not. (Also, In response to the first answer below, I understand that "case insensitive" part wouldn't help, but I thought that the "localized" part may help. I can't find any options to do this and g...