cocoa

How do I prevent a WebView from scaling down a rendered web page?

I'm developing a Cocoa/Obj-C application that involves a WebView (from the WebKit framework). I've noticed that this WebView presents a slightly scaled-down version of the rendered webpage. An example screenshot: In a browser (Safari or Firefox): In my WebView: These happen to be local HTML/CSS files generated by the program, but ...

NSStatusBar animating text

I'm trying to animated text in the NSStatusBar similar to how the text "Dialing ..." scroll from right to left when dialing-up to Internet. I'm not sure how to do this so is there some code example or guide on how to go about this? ...

How to extract pure string from a constant string

When I print the value of a CFString constant e.g. an AddressBook label in the console, the output value is _$!<home>!$_. How do I extract only the pure value, e.g home? ANy help would be greatly appreciated please. ...

How do I find out why file I/O operations fail?

Several methods I've used to write to files return a BOOL signifying their success, e.g. NSDictionary: - (BOOL) writeToFile:(NSString *)path atomically:(BOOL)flag NSKeyedArchiver: - (BOOL) archiveRootObject:(id)rootObject toFile:(NSString *)path Somehow, this returned NO on one of my tester's devices. That's great (well, not real...

Cocoa - Add Video Watermark General Info

Just looking for how to programmatically add a watermark or some sort of overlay to video using cocoa. Not looking for a step by step ( although that would awesome ), but more or less looking for where I should start looking to learn how. Are there frameworks developed to work for this. Would like something native to cocoa or objectiv...

Trying to copy a string into a textfield in objective-C

I am having trouble copying the value of an NSString into a Textfield value. I've done this before, but for some reason it's not working in the function below. Can someone tell me if I'm doing something wrong? pictureComment is the Textfield and comment is an NSString. When I look at the log file, only 'comment' prints. Any suggestion...

Cocoa Java compilation problem in XCode 3.2

Hi, I developed an application in using cocoa using xcode 3.1.Now i upgraded the os version and tried to compile the code in xcode 3.2 But the app crashes with an error " CocoaJava: com.apple.cocoa.foundation.NSRuntime -[NSJavaVirtualMachine initWithClassPath:] FATAL: cannot initialize ObjCJava" I still dont know how to resolve this P...

NSDictionaryController doesn't seem to observe changes to content dictionary

I must be missing something simple, but I am having some trouble binding a tableView to an NSDictionaryController. Here is a model of my current scheme: TableViewColumn --bindsTo-->DictionaryController.arrangedObjects.(value or key) --bindsTo-->someClass.someClassMember.aDictionary. I've tested the tableView by adding a...

How to identify & use OSType in Cocoa

In Cocoa/Mac OSX 10.6 OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer) returns a type OSType where can I find some documentation/reference on the supported OSType with regard to the context of this function. What sort OSType should I expect with IOSurfaceGetPixelFormat? do you have any ideas on the various expected values from t...

autorelease pool causes crash in RubyCocoa application

Hi, I'm having crash in my application, which says trying to pop an unknown autorelease pool: 10/19/09 11:40:11 AM MyApp[89480] *** attempt to pop an unknown autorelease pool (0x11bc800) How to trace it down? Since it's RubyCocoa application it's almost impossible to trace it with gdb in Xcode environment. So mostly it's about loggin...

Need help understanding "kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid Region"

While running my application (which does a good bit of custom drawing) I get this error (it happens a good bit with no observable side effects, but I'd like to understand what's happening). <Error>: kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid region <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch ...

Cocoa: Problem passing a CGPoint with NSNotification and NSDictionary

I'm trying to fire a Notification in a method called setPosition in one class, that triggers setViewPointCenter in another class. However, I'm trying to send a CGPoint along with it. But Xcode isn't liking it one bit. -(void)setPosition:(CGPoint)point { NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"sp", poi...

CGEventTimestamp to NSDate

I'm simply trying to convert a CGEventTimestamp (which is an unsigned 64-bit integer roughly representing nanoseconds since system startup) into an NSDate. I know there's a way to convert "time since system startup" into either an NSTimeInterval or a date relative to a reference date, but I'm not finding it. How do I convert a CGEventTi...

How can you tell if a directory is writeable in Objective-C?

I want to use an open panel to let the user select a destination, but I want to alert them at that point that point that the directory is not-writable. I generally prefer to create it and handle the error, but that's not useful to me here, since I don't want to create the folder just yet. (I'll be sure to handle the error when I do creat...

How can I set rich text properties on a UITableView footer?

Guys- I am using - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { if ( section == 0 ) { return NSLocalizedString(@"Section_0_text", @""); } if ( section == 1 ) { return NSLocalizedString(@"Section_1_text",""); } return nil; } Can I modify return string text font, co...

Why is my value passed through NSNotifcationCenter not preserved?

I'm trying to send a CGPoint through an NSNotification like this -(void)setPosition:(CGPoint)point { NSString *pointString = NSStringFromCGPoint(point); NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"p", pointString, nil]; [[NSNotificationCenter defaultCenter] postNotificationNa...

NSCollectionView draws nothing

I'm trying to set up an NSCollectionView (I have done this successfully in the past, but for some reason it fails this time). I have a model class called "TestModel", and it has an NSString property that just returns a string (just for testing purposes right now). I then have an NSMutableArray property declaration in my main app delegat...

When use clicktoflash, how to show other flashs in a webview based on Safari?

Now I develop a program with a webview showing flash. but I found that when I installed clickToFlash , the webview not to show the flash. I think that when webview load , the safari will check the MIMETYPE , and clickToFlash's MIMETYPE will first chek by safari , so the clicktoflash will handle my falsh , but it didn't have methods to do...

Why is my transformable Core Data attribute not using my custom NSValueTransformer?

I have a Core Data app with a fairly simple data model. I want to be able to store instances of NSImage in the persistent store as PNG Bitmap NSData objects, to save space. To this end, I wrote a simple NSValueTransformer to convert an NSImage to NSData in PNG bitmap format. I am registering the value transformer with this code in my Ap...

How do I delete an entity when removing it from an array controller?

I have an entity (e.g. Employee) in a managed object model that is related to two other entities (e.g. Department and Team). Both relationships are one-to-many (i.e. an Employee must have one Department and one Team, Teams and Departments have many Employees). The two may or may not overlap (e.g. a team might be made up of employees from...