cocoa

How can you suppress all logging in Cocoa app?

Is there a way to force suppression of all logging in a Mac OS X desktop Cocoa app? Sometimes some part of the system or a plugin (which is out of your control) will log messages on behalf of your application to the console (system.log). Is there a way to suppress all logging in your application? ...

Making a full screen Cocoa app

I want to create a full Screen Cocoa application, however my app is slightly different from a conventional fullscreen app. This app would be below everything else, so underneath the menu bar and the Dock, etc. It would have a large image covering up the Desktop and icons, with a custom NSView in the middle with a table view, etc. If thi...

How to convert data to CSV or Html format.

In my application i need to export some data into CSV or html format. How can i do this. Any help will be greatly appreciated. ...

How lightweight is NSOperationQueue on Snow Leopard?

I'm working with some code that does a bunch of asynchronous operating with various callbacks; Snow Leopard has made this incredibly easy with blocks and GCD. I'm calling NSTask from an NSBlockOperation like so: [self.queue addOperationWithBlock:^{ NSTask *task = [NSTask new]; NSPipe *newPipe = [NSPipe new]; NSFileHandle *r...

JNI error on Mac OS X 10.4.11... dyld: Symbol not found: _objc_setProperty

I have a problem with some JNI code. I'm getting the following error printed in the console from a OS X 10.4.11 (PPC) machine (it works fine on newer versions of OS X 10.5+) dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty Referenced from: /Path/to/my/lib/libMylib32.jnilib Expected in: /usr/lib/libobjc.A.dylib ...

Retrieving the value of an NSProgressIndicator.

I am trying to retrieve the value (how far along it is) of a Determinate NSProgressIndicator. I have tried … NSInteger *bValue = [progressIndicator doubleValue]; But it gives an error saying Incompatible types in initialization. So how do I retrieve the value of the Progress Indicator? ...

cocoa capture frame from webcam

Hi to all I'm implementing a software to caputre video from webcam. I've seen MyRecorder sample in Apple Dev and it works fine. I've tried to add a button to take a snapshot from video with this code: - (IBAction)addFrame:(id)sender { CVImageBufferRef imageBuffer; @synchronized (self) { imageBuffer = CVBufferRetain(m...

NSString isEqualToString: for \n

I have an Cocoa app that calls a web service. When I parse the response from the web service I am getting a \n as the last character in my foundCharacters delegate for the NSXMLParser for each element in the XML. When I try to do the following: if (![string isEqualToString:@"\n"]) The check will always fails to catch the newline. ...

Is there an equivalent of -applicationDidReceiveMemoryWarning: on the Mac

I'm looking for an equivalent to the -(void)applicationDidReceiveMemoryWarning:(UIApplication *)application method that's available on the iPhone. So far I haven't been able to find anything, but I'd like to check before I start writing my own. ...

Binding to a NSViewController's representedObject

(Abstract: bindings work in code, but not in IB) I have a window managed by a NSWindowController. To the left of the window is a source view. To the right is a table view showing the elements of the currently selected source. I have set up a NSTreeController within my window XIB. I want its contents to be used for the source view. It's...

OrderFront - NSPanel

Hey Everyone, I have this code: [hudWindow orderFront:nil]; And when I debug it and run the command does not seem to work. hudWindow is a NSPanel. Please help me solve this problem. Thanks Kevin ...

Getting live data from the iPhone on the Mac

Hi, I'm experimenting with the sensors of the iPhone. At the moment I visualize the data of the accelerometer by logging it to a file, downloading the file via Xcode and loading the file into my Ruby-Processing app. As I'm playing around a lot this process is getting annoying. It would be cool to have a live stream of the data on the Mac...

Writing Cocoa applications in Python 3

It looks like PyObjC is not ported to Python 3 yet. Meanwhile is there a way to write Cocoa applications using Python 3? I am intending to start a new MacOSX GUI application project and though5 would want to use Python 3.x instead of Python 2.x. ...

How do I call the original function from the overloaded function in a category?

In Objective-C, I have a category for a class: @interface UILabel(CustomInit) - (id)initWithCoder:(NSCoder *)coder; @end What I'm doing is writing a custom init function that does some extra stuff, and what I'd like to do, is in this custom init function, call the UILabel's base initWithCoder. Is this possible? How so? EDIT Thanks...

PackageMaker Troubles

My PackageMaker project was generating a .mpkg file, but then, all of the sudden, when I go to build, it only generates .pkg files. The .mpkg files are actually directories into which I place my custom installer bundle along with an InstallerSections.plist file to specify the order in which my custom view should display. The .pkg files a...

List all drives/partitions, and get /dev/rdisc device with Cocoa

Is there a way to list available drives, similar to Disk Utility, and get the associated /dev/rdisk* device for it? Disk Utility has access to this data - when you select a drive and press the Info button, it lists.. Partition Map Scheme : GUID Partition Table Disk Identifier : disk0 Media Name : Hitachi HTS541612J9SA00 Media ..or se...

iPhone memory management question and object livecycle

Hi, Here is the code I have: Phone SDK undestanding cocoa object live cycle: - (void) DismissWelcomeMessage: (UIAlertView *) view { [view dismissWithClickedButtonIndex:0 animated:YES]; } - (void) ShowWelcomeMessage { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Blah" message:@"Blah Blah" delegate:self cancelButt...

Is it possible to use an object in a nib as a sort of template for dynamically creating multiple new objects?

I would like to design an NSwindow with a WebView in IB for displaying popup links. I need to be able to instantiate any number of these. Is this possible? ...

Objective C - application crashes when creating an array of strings, am I crazy?

If i try to use this simple code: - (void)applicationDidFinishLaunching:(UIApplication *)application { // Add the tab bar controller's current view as a subview of the window [window addSubview:tabBarController.view]; NSString *stringMer = [NSString stringWithFormat:@"OK COOL"] ; NSString *stringMer2 = [NSString stringW...

Syntax coloring for Cocoa app

I'm planning to do a Cocoa app that requires code syntax to be colored (in all common languages). Instead of writing my own code highlighter/parser, are there any pre-made solutions available? Thanks ...