Home > Articles > Programming > Java

  • Print Print
  • Share ThisShare This
  • DiscussDiscuss

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 ThisShare This
  • Save To Your Account

Discussions

comments powered by Disqus