Git Product home page Git Product logo

Comments (2)

efirestone avatar efirestone commented on July 21, 2024

The reason was simply that the function isn't technically correct. It
implies that there can only be one view with the given class name prefix,
when in fact that's never a constraint. With the UITableView example you
give, indexPathForSelectedRow makes sense for table views where
allowsMultipleSelection == NO as there can only ever be one selected row. A
more correct version of this would be named something like
-firstSubviewWithClassNameorSuperClassNamePrefix:, but under the principle
of "less API is better API" we chose not to add this method. The equivalent
[[view subviewsWithClassNameOrSuperClassNamePrefix:prefix] firstObject] is
only marginally longer and just as clear.

On Wed, Aug 22, 2012 at 2:45 PM, Biclops [email protected] wrote:

I don't understand what is the reason why
subviewWithClassNameOrSuperClassNamePrefix is marked as deprecated. Under
the covers it calls subviewsWithClassNameOrSuperClassNamePrefix, which
returns an array rather than the first instance of a designated class. It
simply puts a nice convenient wrapper around the function to get the first
element in the array.

Is it because the keepers of the code, simply don't want to upkeep the
subviewWithClassNameOrSuperClassNamePrefix function?

There's plenty of functions that behave in a similar manner in the
Objective C library. One example off the top of my head is for functions
indexPathForSelectedRow, and indexPathsForSelectedRows for UITableView's.


Reply to this email directly or view it on GitHubhttps://github.com//issues/147.

from kif.

Biclops avatar Biclops commented on July 21, 2024

I see. That makes. Thanks for speedy response.

from kif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.