cocoa

Can't copy or paste text in Cocoa after deleted edit menu item

I can't copy or paste any text on nstextfield after deleted edit menu item on Interface Builder. I've re-added edit menu item but still can't. Anyone know how to fix it ? Thanks in advance. ...

Relaunching application via NSTask ignores LSMinimumSystemVersionByArchitecture

I'm running into an issue with relaunching my application on 10.5. In my Info.plist I have LSMinimumSystemVersionByArchitecture set so that the application will run in 64-bit for x86_64 and 32-bit on i386, ppc, and ppc64. I have a preference in the app that allows the user to switch between a Dock icon & NSStatusItem, and it prompts th...

NSTimer interval less than sleep command in fired code

I have a snippet of code I want to execute repeatedly, but with the ability to pause and resume it. To do this, I have utilised an NSTimer, which I can stop and start as required. Within the snippet, I use a sleep command to wait for something to update (0.3 seconds). The timer is firing every 0.5 seconds. What would be ideal is to k...

NSImage acting weird

Why is this code setting artistImage to an image with 0 width and 0 height? NSURL *artistImageURL = [NSURL URLWithString:@"http://userserve-ak.last.fm/serve/252/8581581.jpg"]; NSImage *artistImage = [[NSImage alloc] initWithContentsOfURL:artistImageURL]; ...

Help sorting an NSArray across two properties (with NSSortDescriptor?)

I'm a bit of a NSSortDescriptor n00b. I think, though, it is the right tool for what I need to do: I have an NSArray consisting of objects with keys, say, "name" and "time". Instead of verbalizing it, here's an example: input: name: time B: 4 C: 8 B: 5 C: 4 A: 3 C: 2 A: 1 A: 7 B: 6 desired output: name: time A: 1 <--- A: 3 A: 7 C: ...

Mac OS. How to create image from PNG data?

Hi, all! I have an array of data that represents PNG: unsigned short systemFontTexture[] = { ... 0x5089,0x474E,0x0A0D,0x5089,0x474E,0x0A0D,0x5089, 0x474E,0x0A0D,0x5089,0x474E,0x474E,0x0A0D,0x5089, 0x474E,0x0A0D,0x5089,0x474E,0x474E,0x0A0D,0x5089, ... } Can I create PNG file using this data? If yes, then HOW? ...

How to detect if a Cocoa application is 32 bit or 64bit ?

How to detect if a Cocoa application is 32 bit or 64bit ? ...

How to make Cocoa document package type with it's extension hidden by default?

I'm making a Cocoa application which uses document package (bundle) as it's data. I specified an extension and Finder now recognizes the folder with the extension as a document well. But the folder's extension is still displaying, and I want to hide it by default (like application bundle) Is there an option to do this? ...

Using CoreData with an object?

Hi there, this is a beginner's question: Every tutorial I've seen on CoreData focusses on database-backed storage. They all start out with drawing an object model with relationships and whatnot. But my app will be like a simple drawing app, think Illustrator light or OmniGraffle. I have an object in memory for the page and then severa...

warning on nsbundle bundlepath

hi. i want to get the executable path of my bundle. (i want to get the path so i can load images in a NSImageView) i got this. NSString * _Ruta_APP = [[NSString alloc] init]; _Ruta_APP = [[NSBundle mainBundle] bundlePath]; but the compiler says /ControlAPP.m:33:0 /ControlAPP.m:33: warning: local declaration of '_Ruta_APP' hides ...

Getting the Current font of a NSTextView.

How would I get the current font of an NSTextView? ...

Recognizing multiple string values in a single action ...

Thanks again for the help. I have a simple action that checks the stringValue of a textField, and if it matches - a status message prints in a second textField: if (textField.stringValue == (@"Whatever" )){ [outputDisplay setStringValue:@"Success"]; My question is how do I implement multiple input stringValue options in this met...

Putting a 'terminal' in my application?

Are there any frameworks for say, putting a display like in Terminal.app in MY app, and then displaying text on it like usual output to STDOUT? Complete with scrollback and etc.? ...

How to create a subscript with NSAttributedString

I see for NSAttributedString has a specific attribute for superscript, but I can't find one for subscript. What is the general practice for using NSAttributedString to create a subscript character? Example: H2O ...

How do I use an NSProgressIndicator as the view of an NSToolbarItem and have it show in the customisation sheet?

I have an NSToolbar set up in my app. It was created in IB. One of the toolbar items uses a spinner-style NSProgressIndicator as its view, the rest are images. When the toolbar's customization sheet is showing, the spinner does not show in the sheet. I initially thought that this was because the spinner's -displayedWhenStopped was set ...

selectText of NSTextField on focus

Hi Could anybody suggest a method to select all the text of an NSTextField when the user clicks it ? I'm new to Cocoa, and could not find a solution here or on the web. I did find suggestions to subclass NSTextField and then use mouseDown or firstResponder, but it's beyond my skill for now. So I was hoping either there would be an easi...

Iphone Utility App Singleton Problem

This is vexing me in my utility app: I have a singleton declared in the manner specified here: http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html My singleton has 4 declared properties: 3 floats and an int. Now, in my view controller I set the properties like this in an updateSingleton method: [[Singleton share...

Problem with multiple window/NIB cocoa application

I'm having a problem with my Cocoa app. I'm using my app delegate as a controller, and opening one window in a NIB file. Clicking a toolbar button opens another window from another NIB. Clicking save on this second window calls a method on the app delegate/controller. All this works fine. The strange thing is that I can't figure out...

SSpeechRecognizer delegate to be called for any word spoke

Hi all, I read about NSSpeechRecognizer and found that it can recognize a set of commands beings associated with it in delegate: -speechRecognizer:didRecognizeCommand: I have a simple question: can this delegate be called for any word spoken by user?? as I think.. only a finite number of words can be associated with it! Thanks, Miraaj...

Remembering the Selection of a NSPopUpButton for the next launch.

I am trying to get my app to remember the selection of an NSPopUpButton for the next time the App is launched. I tried binding the Selection Index to a NSUserDefaultsController but it has no effect, It doesn't remember the selection for the next launch. What do I need to do? ...