0

有人可以解释一下#ifdef..#else..#endif 在这段代码中的作用吗?它来自一个开源的 iphone twitter 客户端。

#ifdef ENABLE_OAUTH
@interface NTLNTwitterClient : NTLNOAuthHttpClient {
#else
@interface NTLNTwitterClient : NTLNHttpClient {
#endif
    int requestPage;
    NSString *screenNameForUserTimeline;
    BOOL parseResultXML;
    NSObject<NTLNTwitterClientDelegate> *delegate;
    BOOL requestForTimeline;
    BOOL requestForDirectMessage;
    NTLNTwitterXMLParser *xmlParser;
}
4

1 回答 1

3

如果在其他地方定义了 ENABLE_OAUTH,那么类 NTLNTwitterClient 将是 NTLNOAuthHttpClient 的子类。

如果未定义 ENABLE_OAUTH,则类 NTLNTwitterClient 将是 NTLNHttpClient 的子类。

于 2010-07-23T05:35:13.177 回答