Reputation: 265
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
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