cocoa

NSUTF8StringEncoding causes file to render improperly in TextEdit/Pages, but not BBEdit/vi

I'm running into a bit of a weird issue. Whenever I create a new text file in my iOS application, I set its encoding to be NSUTF8StringEncoding. If I edit the file and input any characters with diacritics and save the changes, the diacritics render properly in some applications such as BBEdit, TextMate, cat and vi but not in others suc...

XCode/Cocoa + Quartz Composer + Interface Builder woes.

Hi, So, I can't seem to get this (I thought rather simple) Cocoa app working properly. I have a Quartz Composer patch which writes text files based on GUI input, then recalls the text files and displays them on a second display (ie projector.) Everything works as expected from inside QC. That's not (as far as I can tell) the problem....

How to Detect NSWindow Maximize or Zoom Event?

How do you detect when a user clicks the green maximize or zoom (+) button on the NSWindow without using the NSWindowDidResizeNotification? The reason I don't want to use NSWindowDidResizeNotification is because that is also triggered repeatedly as the user clicks and drags to manually resize the window. I have some code that I want to ...

What does NSLog actually do?

Hi, I am having a weird problem. I am using a method from Apple's private frameworks in my application. When I call it for the first time, it works. When I call it for the second time immediately without anything in between, it crashes. However, if I put NSLog between the two calls, it works wonderfully. So I try removing NSLog and puti...

How come NSRect and CGRect are incompatible types?

Ok , I'm consfused about an error : error: incompatible type for argument 1 of 'initWithFrame:' This is what causes it: operationLabel = [[NSTextField alloc] initWithFrame:CGRectMake(0, self.frame.size.height / 2 - (40 * 3), self.frame.size.width, 100)]; The definition is: - (id)initWithFrame:(NSRect)frameRect; So the firs...

NSTableView unable automatically reload data

Hello. Can I do that NSTableView do not respond For automatically reloadData? for example when I click on hide program window, or some sing else? Another words update data in table must implement only when I call realoadData: method? ps I sink may some method like - unableReload or else, but I can't find it( ...

Problem creating UTF8 text file with NSFileHandle

I want to use NSFileHandle to write large text files to avoid handling very large NSString's in memory. I'm having a problem where after creating the file and opening it in the Text Edit app (Mac), it is not displaying the unicode characters correctly. If I write the same text to a file using the NSString writeToFile:atomically:encoding:...

NSWindowController: loadWindow loads window from nib but showWindow: does nothing

I have an NSWindowController subclass called _PreferencesWindowController with the following implementation - @synthesize window; - (id)init { self = [super initWithWindowNibName:@"PreferencesWindow"]; if (!self) return nil; return self; } And I tried to show the window in _PreferencesWindowController by using the following code...

How to solve the problem:"Expected specifier-qualifier-list before" in XCode?

Hi Guys, I met a problem in XCode. And my problem was similar to this one: http://www.iphonedevsdk.com/forum/iphone-sdk-development/40121-expected-specifier-qualifier-list-before.html So I want to know how to solve the problem in the link above? Thanks in advanced! Nick ...

Setting values in SWF, Cocoa?

Hi, I am trying to set values for a SWF file. I have the SWF in a web view, but I need to set values for it. How would I set values for it? Thanks. ...

Set flash values in Mac app?

Hello I am loading a SWF file in a UIWebView and need to communicate with the Flash file and set its flash values. How would I do this? Thanks ...

How to use XMLHttpRequest in Objective-C?

I'm creating easy to use kannada comic reader on mac for my cousins. I'm able to pull the comic pages, but lot of meta content exchanged webpage and server using XMLHttpRequest. I'm finding difficulties use XMLHttpRequest, could anyone tell me how can I use it? ...

Problem binding an NSArrayController back to an ivar

Hi everybody, I have a problem with a bound property of a custom view. The property is bound to an NSArrayController for a core-data entity. Here's the problem: In my view, I draw several rectangles. The positions of these rectangles are saved in an entity in core data (as NSValue wrapped NSRects). The rectangles are draggable, and wh...

Are selectors in objective - c just another way to send a message to an object?

Are selectors in objective - c just another way to send a message to an object? I really don't understand why or how to use them. ...

-[ImageScrollView index2]: unrecognized selector sent to instance

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientat ion duration:(NSTimeInterval)duration { UIInterfaceOrientation o = self.interfaceOrientation; if ((o == UIInterfaceOrientationPortrait) || (o == UIInterfaceOrientationPortraitUpsideDown)) {D = 1;[self setPaging];} if ((o == UIInterfaceOrienta...

How to use multiple Help Books in a Cocoa Application

I managed to setup the the online help system for the main application help which is using the CFBundleHelpBookFolder and CFBundleHelpBookName from the bundle Info.plist. But i can't display other help files. I use the following AHRegisterHelpBook code which gets called with the help bundle path like "/Users/llothar/Python.help". The ...

KVC array: getters vs indexed accessors?

I'm confused by this: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/AccessorConventions.html#//apple_ref/doc/uid/20002174-178830-BAJEDEFB Supposing @interface Office : NSObject { NSMutableArray *employees; } What is the benefit of implementing the collection accessors? How is [anOffi...

AMShellWrapper not getting data after sending input

Using AMShellWrapper, I'm trying to send data to a running task. However, when I do so, nothing happens, no data is being sent nor received. Any ideas? ...

Core Data, NSTableView and getting Selected Row Value

I'm pretty new to Core Data and managed to get the NSTableView to show my Core Data values. The entity that the table uses is Emotes that have the two properties, Emote (string) and Usage (integer 16) When a user selects a item, it will allow a person to copy that emote to clipboard. In order to do that, I need to get the ManagedObject ...

Release controller, but keep empty pointer?

I have a variable, editForm, that is used as a pointer to a view controller. Later on, I use a delegate method to release editForm when the user taps the button to close the view. @implementation EditViewController EditFormViewController *editForm; [...] (void)openeditform:(NSString*)editId { editForm = [[EditFormViewController ...