NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;
NSAppleEventDescriptor *eventDescriptor;
NSAppleScript *script ;
NSString* source ;
NSDictionary* errorDic ;
source=@"tell application \"iTunes\" \n"
@"set tname to name of track 1 of playlist 1 \n"
@"set tartist to artist of track 1 of playlist 1 \n"
@"set talbum...
I've got an NSTableView that displays (via bindings) data from an NSTreeController. The application frequently appends/changes data to/in the bound array.
The problem is that if the user has selected a row in the table, but has scrolled so that the selected data is no longer visible, when the application updates the array it causes the ...
Hi All
I need to open the network-prefpane in my App. This works fine with
[[NSWorkspace sharedWorkspace] openFile:@"/Path/To/PrefPane"];
But how can i directly open the "proxy-settings", which is in the "network-pref" under "advanced"?
You can see this in the Safari-Settings under "Advanced->Proxies"
Thanks
...
How can I make a window with same basic structure as the Finder window (a menu/source list to the left with icons that can be organized, and the content in a larger view on the right)?
...
Okay, I've got a custom class called "Task", which represents a task to be done. I've got an NSMatrix which acts as a calendar. I want the user to be able to drag an icon from an nscollectionview (I've had no trouble setting up the nscollectionview) onto a cell in the nsmatrix, thereby assigning that task to that day. I just can't see...
Is there any way to send a copy (command-c) instruction without using a cgEvent to mimic the keystrokes? I don't have access to the text field in the application I want to take text from, so need to replicate manually copying to the clipboard, and there seemss to be a bug with cgevent posting.
According the Quartz documentation, to typ...
I have been trying to create a chat bubble for about a month now... (you know, like the one in iChat or Tweetie). At some point I found a thread that said that I could use Twitterfon's source... which I did. But I get stuck for a few reasons. Which ones? Apple didn't seem to implement all the methods needed for calculating the rect's siz...
Hi everyone,
I am writing an application which has to communicate with a device connected via USB. The app sends and receives data in turns from the device on a fixed timing. All Rx/Tx happens in a separate thread because otherwise the UI would be blocked. The basic structure looks basically like this. (autorelease pools and stuff omitt...
I need to figure out the pixel length of an NSString in Cocoa on OSX and I have found a couple of links that describe how to do this using the IPhone sdk but I didn't see anything about how to do this when not targeting the IPhone. Can anyone link me to some docs that would be relevant. I did find anything in the NSString docs.
...
I'm working on a OS X program where the user does some light WYSIWYG HTML editing in a WebView. Being new to programming with Cocoa and WebKit, I have absolutely no idea how to get selected text from a WebView - the intention being to take what the user selected, add HTML code (like div's or span's) around the text, and replace the selec...
I'd like to have a 'Detail view' for when the user double clicks on a row, I'm just not sure how to get the data to the NSViewController, so it can display the content. I'm using CoreData and I can't think of a way to do this.
...
Need some help to figure out how to access Text Boxes inside a slide in Keynote with Applescript. I tried to use ASDictionary but I couldn't find anything that would resemble a text box object. I fear that they are not scriptable in Keynote, but perhaps I can access them through Applescript Cocoa bridge? Any thoughts? Thanks!
...
Hi,
I init my NSXMLParser with a mutable data, that I get from the internet. I wonder whether the parser releases it on its deallocation or I have to release it after the parsing?
Thanks
...
Is there a way to develop windows applications using cocoa and objective-c in general
...
Hello
I am really getting frustrated now! I have a new problem now, all I want to do is say if
lblMessage.Text = "30 Seconds" then do some code
otherwise do some other code
if (lblMessage.text isEqualToString:@"30 Seconds")
{
NSString *strPlayerAtTable = [[NSString alloc] initWithFormat:@"%@ at table", ActivePlayer];
lblMes...
I've done this before but I simply can't remember how I did it =(
So what I'm trying to do is to select a range in a NSTextView and make it visible with the yellow box similar to Safari search. As far as I remember there is a build in API for this but after searching like crazy I haven't found it. And I've asked about it once before on ...
I'm fairly new to Core Data, have looked through many tutorials and forums and haven't found the elegant solution to my problem:
I've got three entities in my model: Worker, Task, and SubTask. Each has a to-many relationship to the entity below it and a to-one inverse. Worker has many Tasks, each Task has many SubTasks, each SubTask has...
Hi, I'm creating images using an NSOperation subclass; threads are spawned to create the images which are displayed in an imageView. The images are set as a key in an arraycontroller, which is bound to the imageview.
Users are randomly reporting the app crashes and the crash log is showing an error in a thread calling the selector _cac...
This function rotates a CGImage by an arbitrary number of degrees, but it clips the image a bit. How can I avoid the clipping?
Making the rectangle a bit larger seems to distort the image being rotated.
+ (CGImageRef)CGImageRotatedByAngle:(CGImageRef)imgRef angle:(CGFloat)angle {
float angleInRadians = angle * (M_PI / 180);
float...
Hi,
I had a question when showing sheets in Cocoa and particularly, the animations. How do I show a sheet (plain NSWindow/NSPanel) with and without the nice animation? It does this automatically for NSSavePanel/NSOpenPanel, but I can't get the nice animation working for a standard NSWindow/NSPanel sheet I create in Interface Builder. (W...