cocoa

How to get the url which the browser is current visiting?

I want to implement a tiny app that can save the current url opening in the browser to delicious. So the first thing to do is get the url. So what function/class can we use to get the curl in the browser? ...

Acessing a QC Structure from a Cocoa Application

Hi there, is there a way of acessing a structure from a Cocoa app? I am able to set integers and Strings using the QCView setvalue:forkey method but when i try to access a structure i run into errors. Basicly what i want to do is to pass a byte array into a Quartz composition. greetings matthias ...

unzipping a file in cocoa

Hi, I have a zipped file, which i want to extract the contents of it. What is the exact procedure that i should do to achieve it. Is there any framework to unzip the files in cocoa framework or objective C. ...

Check NSString for special characters

Hi all, I want to check an NSString for special characters, i.e. anything expect a-z, A-Z and 0-9. I don't need to check how many special characters are present, or their positions, I just need to know whether a particular string contains any or not. If it does, then I want to be able to display "Error!", or something similar. e.g. jH...

Printing the Data in a NSTableView.

How would print what is in my NSTableView? The View uses core data so everything is stored and can be grabbed as an NSArray. But how would I go about printing it out? At the moment when you click the print button it just seems to take a picture of the view and print that. ...

Writing asynchronously on a stream in cocoa

Hi folks I have been trying to find any way for writing asynchronously on a stream in Cocoa. I have a set of events in my applications which will try to send data through the socket but i can't be blocked during this transmission due to design terms. I have tried setting a delegate on the output stream and check the event NSStreamEven...

cocoa vs cocoa touch

I am learning iphone/objective-c development and I find a lot of code examples. Some of them though I only for MacOS. Can someone please explain to me what is the difference between Cocoa and Cocoa Touch (at a library level), so that I know what code will work and what will not work. Thank you. ...

Is Objective-C used without Cocoa?

It seems that Cocoa seems to be the main platform for Objective-C. GCC (which Xcode uses) supports Objective-C so it must be available on a wide range of platforms. Are there any notable cross-platform projects that use Objective-C but not Cocoa (or its open source cousin GNUStep)? Is it really used outside the Apple ecosystem? ...

NSTextView determine if NSTextAttachment is present

Hi, in my MyDocument class I need to determine if there is an image in my NSTextView, so I can prevent users from saving documents as RTF although RTF doesn't support images. Could someone point me in the right direction? ...

How to sort a mutable array with reference to Date which is saved as "object for key" in iphone?

I am new to iphone development .I have mutable array recent in which the values such as title,date,url and summary are stored as " object for key".The keys are myurl,mudate,mytitle,mysummary.I want to sort that mutable array in reference to date and print all the values according to that..How can i achieve that?Please help me out.Thanks....

Cocoa: Element count of property list without building dictionary?

What is the best way to count the number of entries in a property list? I currently build a dictionary from the plist entries (*) and then use the dictionary's count: NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:myPlistPath]; NSDictionary *myPlistDict = (NSDictionary *) [NSPropertyListSerialization ...

get value of selected row NSTableView

how can i get value of selected row in NSTableView? ...

Wait until Preference Pane is completely visible to show sheet?

I'm writing a preference pane to control a script I created, and I want to show a sheet on first launch so the user can tell the pane where they installed the script. The sheet appears fine, the problem is that it appears right after you click the button for my pane. This causes System Preferences to Segmentation Fault immediately. I'm ...

Objective C Introspection/Reflection

Is there a built in method, function, API, commonly accepted way, etc. to dump the contents of an instantiated object in Objective C, specifically in Apple's Cocoa/Cocoa-Touch environment? I want to be able to do something like MyType *the_thing = [[MyType alloc] init]; NSString *the_dump = [the_thing dump]; //pseudo code NSLog("Dumped...

Fast Enumeration With an NSMutableArray that holds an NSDictionary

Is it possible to use fast enumeration with an NSArray that contains an NSDictionary? I'm running through some Objective C tutorials, and the following code kicks the console into GDB mode NSMutableArray *myObjects = [NSMutableArray array]; NSArray *theObjects = [NSArray arrayWithObjects:@"easy as 1",@"easy as two", @"Easy as Three"]; ...

No key/value pairs being saved in NSMutableDictionary

When my app starts, it loops through adding values of random numbers with keys of co-ordinates on a grid to a dictionary. Here is a bit of the code: [grid setObject:v forKey:k]; K is a string in form "xy" where x and y are single digit integers and V is an NSNumber. Both of these are logged to the console before adding so I know these...

Reading Cocoa (not Cocoa Touch) archives on iPhone

If I have a file that was written by Cocoa on a Mac, using NSKeyedArchiver, are there any tricks to reading it on iPhone OS? NSKeyedArchiver exists on both platforms, but the Mac version might archive an NSColor, and iPhone can only unarchive UIColor. There’s setClassName:forClass: but I don’t think that helps. I don’t think it’s liter...

API for Apple mail.app? Not Public?

Hi! I was looking into Apple Mail.App plugin development and I found nothing in regards to a public api for mail.app, except that there were many websites that said there is no such thing?! Is that correct? I honestly can't believe it?! Cheers, alex25 ...

How to set NSPredicateEditor/NSRuleEditor background to alternating rows?

I've seen some apps are using alternating rows background in their predicate editors, but I can't figure out how they do it. ...

How would I write the following rb-appscript in objc-appscript?

The documentation in the appscript objc-trunk randomly uses ruby in the section called "Performance Issues". require "appscript" include Appscript desiredEmail = '[email protected]' p app('Address Book').people[ its.emails.value.contains(desiredEmail) ].name.get How would this be written in Objective-C? I apologize ...