aspose file tools*
The moose likes iOS and the fly likes Why we don't import UIKit (for example) in implementation file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "Why we don Watch "Why we don New topic
Author

Why we don't import UIKit (for example) in implementation file?

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hey,
When doing iOS development, usually you will two files: interface and implementation.
In the interface file you import what you want, like:
#import <UIKit/UIKit.h>
But in the implementation file, you don't import UIKit although you are using its classes, protocols ...
Why we don't import it?
Is it a rule in Objective-C that if you import a file in the interface file then you don't import it in the implementation file?
Thanks.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

John Todd wrote:Hey,
When doing iOS development, usually you will two files: interface and implementation.
In the interface file you import what you want, like:
#import <UIKit/UIKit.h>
But in the implementation file, you don't import UIKit although you are using its classes, protocols ...
Why we don't import it?
Is it a rule in Objective-C that if you import a file in the interface file then you don't import it in the implementation file?
Thanks.


It is being imported into the implementation because the interface imports it and your implementation imports your interface.

C imports b which imports a, so c is importing a automatically.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why we don't import UIKit (for example) in implementation file?