cocoa

Superimposing PDF pages

Hello, I am trying to superimpose two pdf pages; one on top of the other. I am using Cocoa and the PDFKit framework. When I superimpose the second page onto the first, the second page covers the content of the first page entirely (so the first page is no longer visible). Is there a way to change the transparency of the second page so tha...

Is the fact that NSPathControl does not escape percent ('%') characters when bound to a string a bug?

Steps: Environment: OS X 10.6.4 Xcode 3.2.1 Create a new "Application" project. Open the supplied application delegate. Add an NSString * property. In -applicationDidFinishLaunching: set the string property to @"/TestString%". Open up the NIB. Drag an NSPathControl onto the application window. Bind the NSPathControl's value binding to...

ASIFormDataRequest Error

- (void) recordTransaction: (SKPaymentTransaction *) transaction { NSDictionary * receipt = [transaction.transactionReceipt dictionaryFromAppleResponse]; NSDictionary * purchaseInfo = [[NSData dataFromBase64String: [receipt objectForKey: @"purchase-info"]] dictionaryFromAppleResponse]; NSURL * url = [NSURL URLWithString: @"h...

Error when Saving Core Data sqlite in NSPersistentDocument

Hi! I have small COCOA Mac OS application to play with core data. I have overridden default save function to do extra job after saving document (automatically save a zip copy also). Every time I save - program crashes with EXC_BAD_ACCESS in line where I call [super writeToURL ...] The good part is - document is being saved properly. He...

NSArrayController Class vs Entity mode in Core Data Mac OS X document based application

Hi! Can anyone explain differences in practise between NSArrayContoller modes (Class / Entity}? I am just facing some debugging issues in my document based Core Data desktop application (using Entity mode for all my controllers). My database structure became quite complicated and it takes so much time to find wrong bindings (mistyped k...

Load from nib file

I have an IB plugin that contains myController. I can set some properties of the controller in IB's Inspector. These properties are saved in the nib file but at runtime, myController doesn't init with these properties (they aren't read from the nib file). How do I fix this problem? ...

Disable/Enable NSButton if NSTextfield is empty or not

Hello! I´m newbie with cocoa. I have a button and a textField in my app. I want the button disabled when the textfield is empty and enabled when the user type something. Any point to start? Any "magic" binding in Interface Builder? Thanks [EDITED] I´ve tried to set the appDelegate as the NSTextfield´s delegate and added this method ...

What is the difference between NIB and XIB Interface Builder file formats?

What is difference between nib and xib in Interface Builder files? ...

Reading PDF files as string through iPhone application

I am confuse that what argument should i pass in CGPDFDictionaryGetString function for "key"?I want to extract text and image from PDF file. ...

NSManagedObject and KVO vs Documentation

I have a custom NSManagedObject subclass, say, Person. I also have a UIView registered with -addObserver:forKeyPath:options:context: to observe various properties of a Person, some of which are persistent like "name" and others are just dumb KVO-compliant accessors unrelated to Core Data, like "drinking". @interface Person : NSManagedOb...

Cocoa - Insert text between tags

Hello, I was wondering how it is possible to insert text between HTML tags in Cocoa. I am displaying source code in a NSTextView - example: <html> <head> <title>test</title> </head> <body>hello!</body> </html> The code above can vary in size, but what should I do if I wanted to insert say <link rel="apple-touch-icon" href="webclip.pn...

Debugging COCOA Core Data bindings

Hi! In my document Core Data application I receive crash with report in console: Cocoa Bindings: Cannot create NSSet from object <_NSControllerObjectProxy: 0x26acb0> of class _NSControllerObjectProxy I have -NSBindingDebugLogLevel 1 startup vargument enebled and I get only this. Is there any way to get more information which class or ...

How to sort an NSArray of objects by their class?

I have an NSArray of objects that all subclass with their different types from a more abstract class. I would like to sort the array by the object's class type. For example: NSArray with CLASSA CLASSB AND CLASS C subclassed from CLASSz myArray = {C, B, A} Sort myArray decending: {A, B, C} I see sort descriptors and that seems like i...

Sending and receiving XML, to and from server using Cocoa

I have some XML data that I want to transmit to a web server and the response is also in XML. I am trying to use Cocoa to parse the XML. I have followed this document to create the XML and transmit it, but the document doesn't explain very well how you can receive the XML response from the server. I haven't been able to find any good e...

Cocoa Core Data: Setting default entity property values?

I know I can set default values either in the datamodel, or in the -awakeFromInsert method of the entity class. For example, to make a "date" property default to the current date: - (void) awakeFromInsert { NSDate *now = [NSDate date]; self.date = now; } How though can I make an "idNumber" property default to one greater than the prev...

Is NSMutableString's -appendString: method an efficient way to build up a large string?

I'm planning on building up a potentially large string by iterating over a collection and generating chunks at a time. If I were to simply start with an NSMutableString and repeatedly append chunks to it, does that work reasonably efficiently or is it a Schlemiel the Painter situation? It seems plausible to me that NSMutableString is imp...

Playing Speex audio in RIFF-WAV container on Mac OS X

There are speex audio embeded in RIFF-WAV container (The files obtained in Windows system through encoding using Speex ACM codec, WAVEFORMATEX.wFormatTag = 41225 (0xA109) is used). Now I need to write an application, that will play such wav files. I just started to learn programming under Mac OS X, so I am looking for right start points...

Extracting information from a MAC OS X application

Hi :-) I have a simple problem, I will be straighforward. Suppose I have a third-party cocoa application running that has a chat box inside. Well, I need to capture the text inside that chat-box in real time from another application and write a logfile in real time with that information. I am sure there is a way, I just don't know whe...

Disabling accessibility for a table column

I have a normal NSTableView that displays a list of tracks. I have dedicated a table column to displaying an icon that indicates which track is currently playing. I'm working on adding fuller VoiceOver support and I don't like how when each row in the table is selected the first thing said is "image". I would like to disable accessibili...

Converting NSImage to CIImage without degraded quality

Hello, I am trying to convert an NSImage to a CIImage. When I do this, there seems to be a huge loss in image quality. I think it is because of the "TIFFRepresentation". Does anyone have a better method? Thanks a lot. NSImage *image = [[NSImage alloc] initWithData:[someSource dataRepresentation]]; NSData * tiffData = [image TIFFRepres...