supermarin / ObjectiveSugar

ObjectiveC additions for humans. Ruby style.
MIT License
2.17k stars 190 forks source link

feature request: nsstring isEmpty #30

Open mgerlach-klick opened 11 years ago

mgerlach-klick commented 11 years ago

Would you consider adding an [NSString isEmpty] as described here: http://stackoverflow.com/a/899320 ?

stanislaw commented 11 years ago

I think, that isEmpty written this way is more like a method for something more general like NSObject. It is too expensive for NSString exclusively, isn't it?

stanislaw commented 11 years ago

Also, if we do know that thing responds to length and count - then why those casts to NSData and NSArray respectively?

mgerlach-klick commented 11 years ago

That's true, I was mainly thinking of using it for nsstring, but this is really something for NSObject. Perhaps with the added [NSNull null] check mentioned in the comments?

BTW since I have you here: I love your library, thanks for your work!

florianbuerger commented 10 years ago

We can adopt something like Brent Simmon's emptiness functions http://inessential.com/2012/07/28/emptiness