cocoa

shell tool target can't find info.plist..

when I tried to run the program, it showed this message: No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting But there's actually an Info.plist in my Resources group. I already added InfoPlist.strings file into Copy Bundle Resources Is there anything I set wrong? I tried it for so long.....

Deselecting NSTableView when clicked somewhere outside the table.

I have a NSTableView placed on top of NSView. I want to deselect the NSTableView when mouse pointer is clicked on NSView. How to achieve this? ...

encode and decode int variable in Objective-C

How do I decode and encode int variables in Objective-C? This is what I have done so far, but application is terminating at that point. Whats the mistake here? -(void)encodeWithCoder:(NSCoder*)coder { [coder encodeInt:count forKey:@"Count"]; } -(id)initWithCoder:(NSCoder*)decoder { [[decoder decodeIntForKey:@"Count"]copy]; r...

Cocoa - Easiest way to convert the string 'employeeName' into 'Employee Name'?

I have a string employeeName, what's the easiest way to change this to 'Employee Name' in cocoa? Also how would I just extract the first word in the above? ...

Resizing CATiledLayer's Using Scale Transforms vs. Bounds Manipulation

I've got my layer hosted workspace working so that using CATiledLayers for hundreds of images works nicely when the workspace is zoomed out substantially. All the images use lower resolution representations, and my application is much more responsive when panning and zooming large numbers of images. However, within my application I also...

Preventing CALayer Sublayers From Getting Scaled

I have some CALayers in a layer hosted view. Each of these layers has additional layers to hold (1) a close button, and (2) a resize handle. These additional 'control' layers are added as sublayers to the parent layer. Currently, when I zoom the workspace in which these layers reside, everything scales -- including these control layers....

Monobjc and Mac UI for Windows Application

Hi there, I've got an application which was written in C# and is running on Windows and Linux using Mono. Now we need a native user interface for the Mac. Is there a way of doing this using Monobjc? Did anyone ever work with it? Is there any other approach? Thanks for your help –f ...

NSPanel : double animation

Hello, I am trying to animate an NSPanel derived window with a fade-in while sliding (moving from outside to inside the screen) What is way to do a such animation? Thanks in advance for your help, Regards, ...

Sharing NSMenuItems across multiple NSMenus...

Hi, I've got multiple menus in the same application and would like to share submenus between them. For simplicity's sake, let's say one is the main menu, the other the dock tile menu.. I've got submenus that contain quite a few items (let's say font names), many of which I need to keep an iboutlet reference to for various reasons. In...

Place information in Mac Menu Bar Item

I hope this isn't too general. I'm a beginner and I'm trying to learn how to make a Status Bar (menu on the right side) for Mac in Objective-C. I've managed to create the basic outline, but I don't know what the method to use for a particular action: I would like when the drop-down menu appears for it to call a method that will return t...

How to create an application bundle in Xcode?

Alright, I have just finished coding an application in Xcode... How do I create an application bundle out of this? I tried using the "Release" build configuration, but on a tester's computer the application states that the application requires a newer version of OS X. He has the latest one! This is my info.plist. <?xml version="1.0"...

Getting CPU info from Process ID

If anyone could please help me out, that would be great :) This seems to be a tough one. Starting from the process ID, I need to be able to grab: How much CPU the process is taking up in % How long the process has been using the CPU This needs to be written in Cocoa/ Objective-C or C. It also needs to work on Tiger through Snow Leop...

connection beetwen html, js and cocoa by webkit

hi. i have cocoa app with embed webkit, which show simple html with <input id="first_name" type="text"> and <input id="start" type="button"> and i want this: when you click #start button, show up a regular cocoa NSAlert with #first_name value. Well, i need to somehow organize a connection between html,js and cocoa. it it possible? ...

Is the app delegate class needed? (design suggestion)

Hi all I am not clear about the need to create an app delegate class, instead of adding the delegate methods in the viewcontroller directly. Is there any reason why someone want to have a separate delegate class? Style preference? Design constrains? (I am following the MVC model, as Xcode users and app makers do). I am asking since i ...

Testing Classes in Objective-C

I'm trying to find a way to test my objective-c classes like i test my java classes. Whenever i build a java class I just drop a main() method at the bottom of my class and tell eclipse to compile/run the class I'm working with. However, in objective-c I'm not allowed to do this. I have been reading around the web and have heard a lot a...

NSNumberFormatter removes trailing zeros

I have used NSNUmberFormatter in a cell of NSTableView. This NSNUmberFormatter is dragged from the IB library and put in the table view cell. Then from the inspector constraints are modified. However during run of the aplication when I enter some values which has trailing zeros e.g. 9.100, the cell displays only 9.1. How do I retain the ...

How to stop NSTimer scheduledTimerWithTimeInterval Time) userInfo:nil

Hey so i am just making an example application and i am having a little trouble, So i have a table view and then i have a few rows and when a user clicks a row it takes them to a new view. On this view i have a button to play music. I am using a timer to make a slider bar increase based on music duration and remaining time. Now my probl...

adding NSSubmenu item in NSMenuItem

I want to add a drop down menu in one of the entries in the NSMenu Item. (eg. If you click on the Battery indicator on Finder bar, it has an option for Show->Icon,Time,Percentage). Now I add a MenuItem using the following code: menuItem = [menu addItemWithTitle:@"Start" action:@selector(start:) keyEquivalent:@""]; ...

Finder service created using Automator

I have created a Finder service using Automator. Service does appear on finder contextual menu on right click of any Folder. I want the service should be active only for the specific folder and folders present inside it. i.e contextual menu should appear only right click of that folder and folders present inside it. Is there any way to ...

Can I use protocol objects as keys in an NSDictionary?

I've read in Apples docu that (as I expected) an NSDictionary is not constrained just to strings for keys. There's also a post here confirming that Sets can be used. I want to use protocol objects but it' not happening. I initWithObjectsAndKeys and pass @protocol(MyGreatProtocol) as a key. Compiles but I get a runtime error saying someth...