I need to put the image from an NSProgressIndicator into an NSOutlineView Cell. I have written up code that does this for a determinate indicator and it works just great:
NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0, 0, 16, 16)];
[progressIndicator setStyle:NSProgressIndicatorSpinningS...
I am using some code which was originally taken from the Apple sample ViewTransitions to swap two views with each other.
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setType:kCATransitionFade];
[animation setDuration:0.3f];
[animation setTimingFunction:[CAMediaTimingFunction functionWithNa...
I am currently working on an iPhone 2.1 application. I am new to Objective C, coming from a Java background.
My application has as a base the Utility Application template available in Xcode with the iPhone SDK. Currently I have some controls, such as an UISlider and text box, in the FlipsideView. The UISlider already has a method which ...
Apple strongly recommends using the binary plist format when reading large XML-based data sets into iPhone apps. Among their reasoning is the fact that XML parsing is very taxing on the iPhone. However, this requires that files residing on the remote web server be converted first.
For frequently-changing content, it is not acceptable to...
I've had significant success with NSURL, NSURL[Mutable]Request, NSURLConnection with my iPhone applications. When trying to compile a stand alone Cocoa application, 10 line program to make a simple HTTP request, there are zero compiler errors or warnings. The program compiles fine, yet the HTTP Request is never made to my web server (I'm...
I've become very comfortable in the world of pointer-free, garbage-collected programming languages. Now I have to write a small Mac component. I've been learning Objective-C, but as I confront the possibility of dangling pointers and the need to manage retain counts, I feel disheartened.
I know that Objective-C now has garbage collectio...
I'm all for language diversity, but Objective C is insane. So I'm curious: is it possible to code iPhone apps with C++ while using the Cocoa API, etc?
...
I am building a really basic Cocoa application using WebKit, to display a Flash/Silverlight application within it. Very basic, no intentions for it to be a browser itself.
So far I have been able to get it to open basic html links (<a href="..." />) in a new instance of Safari using
[[NSWorkspace sharedWorkspace] openURL:[request URL...
I'm reading Erica Sadun's iPhone Developer's Cookbook, and ran into a question.
She says in the book that the way to find the user's Documents directory is with the code:
[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
but that seems slightly brittle, and dissimiliar to the normal Mac way of doing it, which would be:...
Do I really have to learn Objective-C to develop solid Mac Apps?
As Mac users tend to use only applications that have a nice (native) GUI, i don't think that Mono and GTK+ or any Java GUI (Swing) will fit their needs.
There are projects like Cocoa#, PyObjC and RubyCocoa, but are they ready for primetime?
So do I really have to learn O...
Hi all,
Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.
There's this somewhat-related method in UIApplication:
[UIApplication sharedApplication].idleTimerDisabled;
It'd be nice if you instead had som...
I created a project using the default tab-controller project. I am using interface builder to edit the .xib file and add images and buttons. I hook them up to the FirstViewController object in interface builder (that I created and set it's class to the same as the code file). I hooked everything up using IBoutlets and IbActions.
Everyt...
One of the features of the modern (64 bit OS X and iPhone OS) Objective C runtime is the ability for properties to dynamically synthesize ivars without explicitly declaring them in the class:
@interface MyClass : NSObject {
// NSString *name; unnecessary on modern runtimes
}
@property (retain) NSStrng *name;
@end
@implementation MyC...
I'm hacking on a simple Cocoa app to make blocks move around the screen like a video game. I need to detect key presses, but I'm not going to have text entry fields like a dialog box would have.
How do I get key presses without text controls? In particular, I need to get arrow keys.
...
I'm a total newbie with Objective-C, and it still seems awkward to me. The mix of Smalltalk-style message passing with C-style function calls seems jarring.
I'm not trying to rag on Objective-C, I really want to know what its fans like about it. Can you help this newb see the light? I'm very familiar with C++ and Python. What are ...
I want to update/upgrade the standard Leopard install of Sqlite3 to >3.5 to use the new sqlite_xxx_v2 methods from a Cocoa project.
I can't seem to find any information on how to do this. Does anyone have any tips or a site that outlines the update procedure.
Also is 3.5+ supported on the iPhone. I understand it's embedded so shouldn'...
I'm working on a project for OSX where the user can pick a collection of documents (from any application) which I need to generate PDF's from. The standard Macintosh Print dialog has a PDF button which has a number of PDF-related commands including "Save as PDF...". However, I need to generate the PDF file without requiring user interac...
There are a couple of different ways to remove HTML tags from an NSString in Cocoa.
One way is to render the string into an NSAttributedString and then grab the rendered text.
Another way is to use NSXMLDocument's -objectByApplyingXSLTString method to apply an XSLT transform that does it.
Unfortunately, the iPhone doesn't support NSAt...
Hello! I have got two classes, one a subclass of the other (say Animal and Dog). The superclass has got some initializers (say initAnimal), the subclass has some initializers (say initDog). The problem is that it is perfecly legal (from the compiler’s viewpoint) to do something like Dog *adog = [[Dog alloc] initAnimal], ie. initialize a ...
Hi,
I found out how to get the content of the NSPasteboard, and to copy it into my active application. I haven't found a way to paste it into another application, just how to paste it into my current application.
If you're wondering why I would want to do this, I'm researching if there is a way to improve Jumpcut open source applicatio...