cocoa

What's the difference between formal and informal protocols in Objective-C?

What's the difference between formal and informal protocols in Objective-C? ...

What does NS stand for in NSString or NSXMLParser in Cocoa objective-c

Possible Duplicate: What does the NS prefix mean? Wondering the prefix of those classes within Cocoa objective-c on iphone. What does NS stand for? ...

How to remove all contacts from AddressBook efficiently using the AddressBook framework ?

I have written code as below for removing all contacts from addressbook. But it works very slow for more then 1000 contacts. is there any other way for removing all contacts from addressbook. I needs that for restoring backup in my application. -(void)removeAllData { ABAddressBook *book = [ABAddressBook sharedAddressBook]; int count ...

Cocoa - loading a view from a nib and displaying it in a NSView container , as a subview

I've asked about this earlier but the question itself and all the information in it might have been a little confusing, plus the result i want to get is a little more complicated. So i started a new clean test project to handle just the part that im interested to understand for the moment. So what i want, is basically this: i have a vie...

Cocoa/Iphone dev - target/action mechanism

Hi, I started learning Iphone development. As i'm reading about the cocoa development framework, few principal notions came around and with it a little bit of confusion. I want to make sure I understand things right and to get a little clarification : Delegate - basically the strategy design pattern. I set my class delegate and data so...

Why does NSNotificationCenter throw an exception when I release it?

This isn't so much a question as a pondering thought - why does NSNotificationCenter throw an exception when it's released? I'm still new to iPhone development, and thus don't know the innards of Cocoa yet, so it'd be good to understand why. I'm assigning the defaultCenter to a variable, calling addObserver:selector:name:object and then...

How to access windows hierarchy for my application on Mac?

I mean all the windows which belong to my application (process). I need to get something like (NSWindow *) for all of them. Notice, some windows were created by third-party plug-ins and are not accessible by [NSApp windows]. Yes, I know, Quartz Window Services can return all the windows by PID. But how can I get NSWindow by CGWindowID th...

can't find managed object model?

I created a entity called photo inmy .xcdatamodel. but when I tried to add it into my context: NSManagedObjectContext *context = [self managedObjectContext]; Photo *p = [NSEntityDescription insertNewObjectForEntityForName:@"Photo" inManagedObjectContext:context]; it had run-time error: +entityForName: could not locate an NSManag...

strtotime -> NSDate

Hello, is there a way to convert strtotime-like Strings (e.g.: '-3 days' with a given date) with NSDate? ...

NSPredicateEditor Just Won't Show Up

I'm having a really weird problem. I'm trying to put an NSPredicateEditor into my interface using IB, and when I build the app it just shows up as an empty gray rectangle. This is without my applying ANY CHANGES WHATSOEVER to the defaults, including not modifying the default templates. What could possibly be going on? ...

confused about NSString *str ...

I am kind of confused by the behavior of NSString *str.. I assigned it in several ways, sometimes it works, and sometimes it becomes null. NSString *str = @"/hi/hello"; // this one always works // this sometimes becomes null after the function ends NSString *str2 = [str lastPathComponent]; // as above NSString *str3 = [NSString string...

Cocoa - Pass parameter for setAction

Hello Everyone. I thought I'd try my hand at creating a simple cocoa app. It is a simple inbox notifier for reddit. I am bringing in a bunch of URLs and would like to make menu items for each URL with a link to the page. I 'd like to set the actions of each, dynamically. I need to pass the URL to the method, so it knows where to go. ...

Looking for Objective-C Spreadsheet Control

The company I work for has a Window application that includes integrated word processing and spreadsheet components. We use TextControl and FarPoint for the implementation. We have been developing an OS X counterpart for this application. The word processing functionality is actually pretty easy--the standard multi-line text view make...

Obj-C: FSEvent Reports the Same Event Upon Each Launch of the App

I setup a FSEvent that runs well but it keeps reporting the same event each time I launch the app. Ex: My FSEvent monitor directory is: Test/ ...and there are three files: test1, test2, test3 However, after I deleted test1 in my FSEvent Directory, it keeps telling me that test1 has been deleted every time I run the program inst...

Cocoa - keyboard reference numbers for hotkeys; any docs detailing these?

I'm currently coding an app that has hotkey functionality, I've done some reading and was surprised to see it is all done via an old Carbon API. However, perhaps the biggest dilemma is I am unable to calculate the "Keyboard Reference Number"s it requires. The only app I have seen that makes this possible (ASyncKey) won't work anymore as...

objective-c nsarray to c array

Sorry, I'm not even sure how to ask, since I'm a complete newbie at C, pointers and stuff like that. There's a function that accepts an argument: char **arg. If I write that argument like so: char *cargs[] = {"blah", NULL}; and pass it to the function: function(cargs); it works. but ... I have an NSArray of NSStrings and I need to ...

Subclassing/extending NSMutabelSet?

Hey, Is it possible to to subclass NSMutableSet? I need to do this in order to not retain objects contained in this set. The purpose todo that is to make an set of observers and those do not need to be retained. Is it possible to do this or maybe you have an another solution. Needles to say, I do know KVO but the pattern I have descri...

integerForKey: always returns zero

Hi, i'm trying to retrieve a value from my preference file which is an integer. The funny thing is that it always returns zero, although it does exist and the names for both integerForKey: and setIntegerForKey: are the same. Here's how I retrieve the value: [defaults integerForKey:@"BackUpSize"]; And here I set it: [defaults setIntege...

How to split pdf using objective-c?

I have implemented one desktop application(MAC). Now i want to add split pdf functionality.I dont know how to implement. If any resources available then please advice me. Thanks in advance. ...

Cocoa combo box like Safari

Using Cocoa, I'd like to create a "combo box" as seen in Safari - think "select your state" where you click it, it drops down and has every option listed, and you choose them. This differs from the standard NSComboBox because it doesn't have a blank line in it. And it's also not so totally ugly.. ...