0

誰かがこのコードで#ifdef ..#else ..#endifが何をするのか説明してもらえますか?これは、オープンソースのiphonetwitterクライアントからのものです。

#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 に答える