cocoa

Things app tasks. How?

Guys, any thoughts how create interface elements as tasks in Things application ? is it Nstableview? ...

Hide, show annotation on MkMapView

How to hide annotation when zooming out the map view. I have a big number of annotation i have to hide them because if the region displayed on the map is too big you can see only the annotations. ...

getting instance id for nsstring

I am trying to find out how to print instance id for known objects like NSString and NSNumber. When i try using it on any of those objects i just get content not the instance id. Help will be greatly appreciated Thanks ...

Mac OS X. No such file or directory for Lua framework.

I have Cocoa project which uses Lua.framework. In the header file I try to include some .h files from this framework: ... #include <lua.h> #include <lauxlib.h> #include <lualib.h> ... And when I compile the source file I get this error: error: lua.h: No such file or directory error: lauxlib.h: No such file or directory error: lualib...

JavaScript alert() not working in embedded WebView

When embedding WebView in an application and loading html-pages in it, JavaScripts alert()/confirm()/etc. do not work. Looking around in the documentation, there are no related settings in WebPreferences - the only thing that looks related are WebUIDelegates -(void)webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame: etc ... but...

How do I get the current date?

How can I get the current date, and format it like "20/12/2010"? Thanks in advance..:) ...

Call cocoa app from context menu item click

Hi I am creating a CMI plugin in Carbon to add a menu item to my Finder's context menu. I would like call some web services when the item is clicked. Now since the context menu selection handler is written in C, I am not very sure if I would like to do it there. Is it possible to call a Cocoa application on the context menu item's cli...

How to write a Cocoa OpenGL app in C++?

I'm writing an application that needs to use OpenGL, on the Mac, in C++. Is there anyway I can get Cocoa to just give me an OpenGL context and let me do my work in C++? (I want my app to run on both Mac OS X and iPHone; but all the GUI is in OpenGL, I just need a OpenGL context). Thanks! ...

Am I crazy? Help with NSFileManager delegate method shouldProceedAfterError in 10.5+

So I'm kind of a Cocoa n00b, but I'm writing this simple little program and I can't get the NSFileManager delegate method "shouldProceedAfterError..." to fire. Here's the code I'm running in my AppDelegate -(BOOL)copyFile { [[NSFileManager defaultManager] setDelegate:self]; NSError *copyError = nil; NSString *filename = [[N...

vertically aligning text in NSTableView row

Hi all, I have a small problem with NSTableView. When I am increasing height of a row in table, the text in it is aligned at top of row but I want to align it vertically centered! Can anyone suggest me any way to do it ?? Thanks, Miraaj ...

Leaks on app exit.

I am wondering is there a way to find out memory allocations that dont get deallocated on iphone application exit or it's termination . I have been using instruments fixed most of leaks that I had in my application, but i am worried that there are still some allocation that i didnt release. Thanks ...

Is there a constant for how big a GB is in Cocoa?

Apple has (apparently) changed how they calculate KB, MB, and GB in 10.6. Instead of using 1024, they use 1000. (As described here: http://reviews.cnet.com/8301-13727_7-10330509-263.html) My question is how do deal with this in my code? I'm trying to get the amount of space free, so I get the number of bytes via NSFileManager. When I go...

Unable to set text in NSTextView

::Edit:: It works now? haha, maybe I just didn't save my latest IB...who the hell knows. Thanks! Hey, This is my first time playing around with desktop applications (I have experience with iphone applications) and I'm stuck - My text view will not update to show any text: .m: @synthesize textView; NSString *txt = [[[NSString all...

Cocoa: Accepting and responding to keystrokes

Hey everyone, I'm a newbie and I have what I anticipate will be a pretty easy question to answer. In order to learn a bit about event handling and drawing, I'm attempting to write a program that draws a black rectangle that increases in length every time the user hits the 'c' key. So far it just draws a black rectangle on a blue backgr...

Bluetooth Transfer for Core Data Entities

How would I go about using bluetooth to transfer a core data entity with it's corresponding relationships? I have three core data entities with inverse relationships set up and it all works fine, but I need to transfer these to another iPhone based on the context that it is not in the corresponding table in the core data entity set on th...

Can I program a table to look like a table

Can I create a table (TableView) and have it display values for three Columns:- Col1,Col2,Col3 with N values under these three columns? Col1 Col2 Col3 Value1 Value1 Value1 Value2 Value2 value2 Value3 value3 value3 .... ... ... .... ... ... .... ... ... Va...

Webview loading spinner in Xcode

Hi, I'm loading a remote URL in a Webview, and I want to show a spinner while the content is loading. I have the following code, but the spinner doesn't go away when the content finishes loading. How do I make it so the spinner disappears after the content is loaded? NSURL *noteURL = [NSURL URLWithString:@"http://google.com/"]; NSStrin...

Alter NSString to get nothing back

Hi there. At two stages of my app's runtime, I am sending an NSString to the following method. I receive no warnings or errors in the code editor or the debugger, but when I NSLog the output (secondString), I only get given the memory address of the object. Is there something I am not doing right here? - (NSString*)validateString { ...

Mac / Cocoa - Getting a list of windows using Accessibility API

(Re-written for clarity} I want to use the Accessibility API to get a list of all windows for a given application (external). It looks like I should use The goal is to check if a certain window is open. First I check that the application is running (using [NSWorkspace runningApplications] and checking each one), and then I want to ...

Can NSCollectionView autoresize the width of its subviews to display one column

Hi, I have an NSCollectionView that contains a collection of CustomViews. Initially it tiled the subviews into columns and rows like a grid. I then set the Columns property in IB to 1, so now it just displays them one after another in rows. However, even though my CustomView is 400px wide, it's set to autoresize, the NSCollectionView...