Tag: cocoa

Is there a way to get the x,y co-ordinates of all points of a NSBezierPath object?

If i have a NSBezierPath object , is there a way to get co-ordinates(x,y) of all the points drawn. I want to move a NSRect along the path.

How to find out who is the caller of a method or function?

This question already has an answer here: How to find out who called a method? 9 answers

How can I get codec information for a quicktime video in Objective C/Cocoa? (Without FFMPEG)

Hello and thanks for your time, I am creating an application that moves video files around to be processed by other applications. In the past, I have used mediainfo, and ffmpeg, in ruby to obtain codec information about each file. I would however like to transfer all of this into one beautiful cocoa app. I […]

NSURLCredential and NSURLConnection

I have been trying to search for a way to unset the credentials once you set a NSURLCredential with a NSURLConnection that is using NSURLCredentialPersistenceForSession, but I couldn’t find a working solution. Removing the NSURLCredential from the NSURLCredentialStorage only removes it from the storage and not from the NSURLConnection cache. I tried turning cache off […]

Drag a button in OSX 10.8 SDK/objective-c

I started using objective-c today in order to develop an app for OSX (mountain lion). I have a bunch of buttons that I would like to drag them into some other object, for instance a text field. I followed the tutorials on apple’s dev site, but I wans’t able to get the drag part working […]

Circular NSSlider with stop (non-continuous)

I am not sure how to phrase this better as a title but I need to make an NSSlider that functions as a normal volume knob. At the moment it will spin around as many times as I hold the mouse down and move it around the control. I need it to stop at the […]

In what way a view or a window could know that mouseDown outside itself in Xcode?

I want to design a panel acting a little like a popover: when mouse down outside it, it may dismiss or hide itself. But I have no idea about how to achieve this. What I know is that a view could handle -mouseDown, -mouseUp, etc. But when mouse down at other place? I don’t know […]

Custom Modal Window with Block Completion Handler

I’m stuck! I am trying to create a custom modal dialog. I would like it to perform similarly to the NSSavePanel using a block as a completion handler. I’ve copied only the important snippets I think are needed. @implementation ModalWindowController – (void)makeKeyAndOrderFront:(id)sender modalToWindow:(NSWindow*)window sourceRect:(NSRect)rect completionHandler:(void (^)(NSInteger result))handler { _handler = [handler retain]; session = [NSApp […]

How do I bind programatically in the view subclass of my NSCollectionView?

I’ve successfully created an NSCollectionView and added a label to the view prototype in IB, bound to a property of my represented object. I now want to programatically create an NSButton and NSTextField with the NSTextField bound to a property of my represented object. When the button is clicked I want to show and hide […]

How to give NSWindow a shake effect as saying NO, as in Login failure window

I use below code for shake a view and it works properly,now i want to shake a window i change two line that i bolded in code with code2 but doesn’t work //——– code 1 CGFloat DegreesToRadians(CGFloat degrees) { return degrees * M_PI / 180; } NSNumber* DegreesToNumber(CGFloat degrees) { return [NSNumber numberWithFloat: DegreesToRadians(degrees)]; } […]