When I create an NSObject subclass, I always get an empty implementation. There are some things I always put in my code like pragma marks and -dealloc methods. I prefer to just delete stuff that I don't need over writing it with typos from scratch every time I need it. I need -dealloc and -init almost always, but they don't ship with the...
Now I clicked a button in the mainwindow and show a modal window ,then in the modal I clicked a button to show another modal window , now I found When I closed the top modal window ,the focus didn't in the next level modal window , I open the modal window used the func:
[NSApp runModalForWindow: ]; How to let the focus in the next level ...
I have an NSTableView bound to an NSArrayController, which is bound to an NSManagedObjectContext with one Entity. How can I programmatically set a property on the object currently selected in the table view? I tried doing it directly through
[[[documentsController arrangedObjects] objectAtIndex:[tableView selectedRow]] setObject:[NSDate...
I have this line of code to convert NSString to NSData:
NSData *data = [NSData dataWithBytes:[message UTF8String] length:[message lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
How do I do this in Unicode instead of UTF8? My message may contain cyrillic characters or diacritical marks.
...
Currently, any time I manually move a UIImage (via handling the touchesMoved event) the last thing I call in that event is [self setNeedsDisplay], which effectively redraws the entire view.
My images are also being animated, so every time a frame of animation changes, i have to call setNeedsDisplay.
I find this to be horrific since I d...
I'm having a severe memory leak issue with my program. I'm using Apple's Instruments to track my leaks, and in the first few seconds after my app starts there are hundreds and hundreds of leaks listed. The problem is none of them seem to tell me where the leak is coming from.
I've gone through all my classes and made sure that anything ...
Hi,
i need a simple logging solution while writing Cocoa/OpenGL application in C++.
I'd like:
cout << "debug line" << endl;
to open a console window and show the text. Is it possible?
I'm using XCode, maybe it has some logging utility in debug mode?
Thanks in advance,
Etam.
...
Hi,
I'm using this method by Dave DeLong to calculate the size of a folder using the Carbon File Manager API:
http://github.com/davedelong/BuildCleaner/blob/b2712242b4eea1fff0e78a08b393a417e3019c8a/NSFileManager+FileSize.m
(Its the first method there)
The issue I'm having is that some folders (.app bundles in my case) are not reporti...
Apple has deprecated NSObject's poseAsClass: method for OS X v10.5 and above. Is there another way to make class posing work?
...
I've got an app with a webview. It was working great, and then I moved the webView into an NSSplitView. Now it seems for some reason that whenever I press any key to enter text into the webview, it scrolls down. I haven't a clue as to what could cause this. Please help!
...
As the title says, my app crashes when garbage collection is not enabled. The app pops up for a few seconds and then it just crashes, with nothing but this in the debugger console:
[Session started at 2009-08-17 15:03:20 -0600.]
GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009)
Copyright 2004 Free Software F...
I'm working on a simple code editor in Cocoa. I have a text view, and I want it so that when the user hits return, the new line is indented the same as the previous line (like in Xcode or any other code editor).
My problem is that I can't figure out how to either intercept when the return/enter key is pressed or when a new line is creat...
I'd like to submit to the following URL in a Cocoa app and save the results to a string (although XML is probably better):
http://translate.google.com/translate_t#en|fr|hi%20there%20all
The page keeps returning an error. Here's my code:
NSString *urlString = @"http://translate.google.com/translate_t#en|fr|hi%20there%20all";
urlStrin...
Hi,
I am developing an application in cocoa which consists of a client part written in java listens for a request from server (like reading some songs or files from client machine) sometimes this works fine but some times an Exception like "Recieved Signal SIGPIPE" occurs .I have no idea about this exception and how to handle this
Thanks...
What is the difference between isEqual: and isEqualToString:?
Why are classes adding isEqualTo* methods (isEqualToArray for NSArray, isEqualToData for NSData, ...) instead of just overriding isEqual: ?
...
I have just added ILCrashReporter-NG to my application to log application crashes. Unfortunately it seems to have broken my Sparkle updates (Sparkle gives an error when the appcast has downloaded and the Install button is clicked). I have added the ILCrashReporter launchReporterForCompany: report addr: method to applicationDidFinishLaunc...
I have an application with many NSToolbarItems. Only 5 or so are needed at any one time so it seems like the best way to fit them on the screen and make them easy to get to is to hide/display only the NSToolbarItems depending on the context.
I can't find either through google or in the Apple doc's how to do this. Is there a way? (Short ...
Hi, I have a NSTableView as a very central part of my Application and want it to integrate more with the rest of it. It has only one column (it's a list) and I draw all Cells (normal NSTextFieldCells) myself.
The first problem is the highlighting. I draw the highlight myself and want to get rid of the blue background. I now fill the who...
I have an document based application which formats an XML file.
Writing and reading of document is done in my NSDocument subclass
- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
but if the fil...
I've got an NSImage being drawn on a subclass of NSView. In a previous question, I was helped to draw it upright in the upper left corner. Now, I want to be able to rotate the image. I have a button that increments a rotation variable %4, and then I multiply this by -90 to find the rotation angle. I then use an NSAffineTransform to rotat...