8

कोई भी सामान्य श्रेणी के लिए उद्देश्य सी में आगे की घोषणा का उदाहरण दे सकता है न कि श्रेणी या प्रोटोकॉल के लिए?क्या कोई भी सामान्य श्रेणी के लिए उद्देश्य सी में आगे की घोषणा का उदाहरण दे सकता है न कि श्रेणी या प्रोटोकॉल के लिए?

उत्तर

8
/* 
    using a forward declaration of NSDocument, there's no need 
    for every source that encounters this header to include AppKit, 
    allowing much faster compile times and reducing dependency 
    changes for clients. 

    of course, MONThang.m will need to include AppKit to use NSDocument 
    - but the clients using MONThang do not need to import AppKit. 
*/ 

@class NSDocument; // << the forward declaration 

@interface MONThang : NSObject 
{ 
    NSDocument * document; 
} 

@end 
+0

क्या आप कार्यान्वयन में इसके उपयोग के साथ कस्टम क्लास के मामले में इसका उदाहरण दे सकते हैं। – Prabh

+0

@ प्रभा प्रतिक्रिया – justin

+0

अपडेट की गई है, लेकिन जब हम जानते हैं कि आखिरकार हम एनएसडी दस्तावेज़ को कार्यान्वयन में आयात करेंगे तो क्या होगा? – Prabh