cocoa

How to read PNG image to NSImage

Hi how can i read PNG image to NSImage. I tried the following way,but when i get the width and size of the image i'm getting some weird value.. if any one can direct me in right path.. highly appropriate.. NSImage * picture = [[NSImage alloc] initWithContentsOfFile: [bundleRoot stringByAppendingString:tString]]; NSLog(@"sixe %d %d...

how to change UIKit UIImage:drawInRect method to AppKIt NSImage:drawInRect Method

Hi, i'm porting an iphone app to Mac app,there i have to change all the UIKit related class to AppKit. if you can help me on this really appreciate. is this the best way to do below part.. Iphone App-->using UIKit UIGraphicsPushContext(ctx); [image drawInRect:rect]; UIGraphicsPopContext(); Mac Os--Using AppKit [NSGraphicsContext sa...

launching keyboard of languages other than english

hi, i have build a Mac OS X sample application which can open on screen keyboard using NSWorkSpace methods which is in english keys only. But, when i set the localization to other language to japanese(say) then what should i do to launch the on screen key board with keys appearing in japanese language. ...

Cocoa Application with Menubar but no Dock Icon / switch menu

Hi, This is yet one more of those "how to switch from running with a dock icon to running without one" questions with a twist.. I don't want the dock icon but I do want a menu bar when the application is at the front. Is that possible? Running an application with LSUIElement set to 1 in the plist will launch the application without a d...

How do I get the folder numbers from internet

I have a server on the internet which contains several subfolders like followings, each folder contains several datas, I would like to download a certain amount of data from the server (ex: all the data in the folder a\b\01), my question is, how can I get the subfolder number of the folder 01? in this case the number is 8, but how can I ...

Why is QuartzCore reported as leaking in my app?

When I view my app's memory in the xcode memory tool, i see that something called QuartzCore is reported as leaking many times. Each leak ranges from 16-80 bytes. My code is not referencing this. it's all from withing UIApplicationMain(). So I'm not sure how to control this. Any ideas? Thank you. ...

NSZombieEnabled hides EXC_BAD_ACCESS error entirely

So I have a subclass of a UIView that starts causing EXC_BAD_ACCESS errors when I go through a specific set of conditions (run on iPad instead of iPhone or simulator, first login only). It throws the exception when the UIView subclass gets autoreleased from the pool (i.e. the pool is releasing, not when I'm calling [view autorelease], du...

Cocoa UI Elements Not Updating

I have a few Cocoa UI elements with outlet connexions to an object instantiated within an NSView object, which is in turn put there by an NSViewController. These elements, a definite progress bar and a text label, are not updating: the progress bar is dead and empty despite having its value change constantly, the text label does not unhi...

NSOpenGLView in NSSplitView

When i put an NSOpenglView in NSSplitView, a problem occurs while dragging splitter. The openGLView and SplitView are resizing asynchronously. i found a solution in apple mail list thread http://developer.apple.com/mac/library/samplecode/GLChildWindowDemo/Introduction/Intro.html and i found a solution with some carbon calls. but now i g...

What does MVC class organization look like for multiple views and controllers?

The idea of MVC itself seems clear to me but I have trouble understanding how the concept 'scales up' to multiple views and controllers. It appears that Cocoa takes the approach of the controller being the 'switchboard' between the model and the view. How would the application be organized and function in case of multiple views? If ther...

Data sources and NSTableView

I know that table sources need a data source to hold the data that the tableview will display. Lets' say that I'm going to make my AppController be the data source of my tableview and that I make the connection in interface builder. My question is since my actual data is going to be stored in an array,let's call it myArray, when I set th...

Can't Convert NSNamedColorSpace to NSDeviceRGBColorSpace?

Can anyone tell me why this colorUsingColorSpaceName is returning nil? For example, the following code block will print "deviceColor is nill": NSColor *color = [NSColor windowBackgroundColor]; NSColor *deviceColor = [color colorUsingColorSpaceName: NSDeviceRGBColorSpace]; if(deviceColor == nil) NSLog(@"deviceColor is nill"); How can I...

Any way to ask a method for its name?

I'm trying to debug an iPhone app I'm working on, and the idea of adding fifty NSLog statements to the various source files gives me the willies. What I'd like to do is write a pair of statements, say NSString *methodName = [self methodName]; NSLog(@"%@", methodName); that I can just paste into each method I need to. Is there a way t...

ScriptingBridge causes iTunes to relaunch after quit

I'm working on a Cocoa app that monitors what you're listening to in iTunes, and since I'm targeting Mac OS 10.5 and higher, I've decided to use Scripting Bridge. If I try to close iTunes too close to the time that my app polls it for the current track, iTunes will immediately relaunch! The only way to reliably prevent this behavior is ...

NSArrayController binding : Suppress "No selection"

Hello, I have a texfield bound to an ArrayController. The controller key is "selection" because I select items from a NSTableView. But when there are no items in the table the textfield shows the gray text "no selection". How can I suppress this text and have just an empty textfield? Or how can I change the "No selection" text to somet...

Cocoa-Binding : Submit changes manually?

Hello in my application I have a NSTableView bound to an ArrayController (arrangedObjects). I also have a Details-View (just some textfields) bound to the same Controller (selection). Now every time I edit a textfield the changes are automatically send to the ArrayController and the Table changes as well. How can I avoid this? What I w...

opening swf files using WebKit framework

Hi, Can any one tell how can i open an swf file using WebKit framework. Please specify the link which specify instructions to do the same. ...

compatible dll file for ionic.zip.dll

Hi, i have an application in MS Visual studio that uses ionic.zip.dll, can any one knows the compatible dll for the same in Mac OS X so that the file zipped in Mac OS X application could be opened with the same ionic.zip.dll. ...

Creating a Pop animation similar to the presentation of UIAlertView

I would like to present a view in the same manner as that of UIAlertView - a pop/spring. Unfortunately subclassing UIAlertView is not an option for the view I need to present. I have written some code, but I can't seem to get it as realistic as I would like. I would appreciate any suggestions for greater realism or a link if anything sim...

Can I restrict the NSMutableArray object type?

I want the NSMutableArray only store "MyObject" only... ...instead of any objects. How can I do this? thz. ...