Praksha
Praksha

Reputation: 265

Unused Entity issue

I am getting "Unused Entity Issue" warning from following code at line number 4(for logout variable). But I am using that. So how come it is unused ?

        NSString *actionSheetTitle = @"xxxx";
        NSString *tour = @"xxxx";
        NSString *feedBack = @"xxxx";
        NSString *logout = @"Log Out";

        #ifdef XXXX
            UIActionSheet *actionSheet = [[UIActionSheet alloc]
                                          initWithTitle:actionSheetTitle
                                          delegate:self
                                          cancelButtonTitle:@""
                                          destructiveButtonTitle:nil
                                          otherButtonTitles:tour, feedBack, logout, nil];
            [actionSheet setCancelButtonIndex:3];
        #else

            UIActionSheet *actionSheet = [[UIActionSheet alloc]
                                          initWithTitle:actionSheetTitle
                                          delegate:self
                                          cancelButtonTitle:@""
                                          destructiveButtonTitle:nil
                                          otherButtonTitles:tour, feedBack, nil];

            [actionSheet setCancelButtonIndex:2];
        #endif

    }

Upvotes: 0

Views: 531

Answers (2)

vinay
vinay

Reputation: 361

In the else condition You are not using the "logout".

Upvotes: 0

Gal Marom
Gal Marom

Reputation: 8629

when you are using #ifdef and #else the Xcode is "hiding" one of the sections.

That's why it does't consider it as a part pif the code and aware you.

Upvotes: 1

Related Questions