Home > Articles > Home & Office Computing > Mac OS X

  • Print
  • + Share This
Like this article? We recommend

Java Header

Although it is possible to use Java objects without writing header files, it will cause the compiler to produce warnings and inhibits the use of XCode's auto completion. To avoid this, each Java class should have its header defined. For URLRetriever, the header is very simple:

@interface URLRetriever : NSObject {}

- (BOOL)setURL:(NSString *)url;
- (NSString *)retrieveSource;

@end

Now this header can be imported into the Objective-C classes and used directly without any compiler warnings.

  • + Share This
  • 🔖 Save To Your Account