I have a method which checks an NSData's value as follows:

if (data == nil) {

//Method

}

But despite all of the stuff inside the method, it turns out that over 80% of the time is spent on the first line, checking if the data is equal to nil. Is there a more efficient way to do this?

link|improve this question

77% accept rate
Where does the variable get set? I think we need to see more code. – user1415038 9 mins ago
Is it possible the stuff inside is executed only at 1% of the runs because data is mostly nil so even if it takes longer time, it is almost never executed and takes less total time? – Dani 4 mins ago
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.