Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8967029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:09:19+00:00 2026-06-15T17:09:19+00:00

The if condition works at the first loop but it doesn’t work at the

  • 0

The “if” condition works at the first loop but it doesn’t work at the second loop
i dont understand why it doesn’t want to check my condition at the second loop and why does it only work at the first loop

for (UIView *view in dro.subviews) {
    for (TOJDropableButtonView *v in view.subviews) {
        if ([v.type isEqualToString:targetView.filterItem.searchFilterItem.type]){
            NSLog(@"%@", targetView.filterItem.searchFilterItem.type);
        }
    }
}


-[UIImageView type]: unrecognized selector sent to instance 0x161bb960
2012-12-11 20:18:00.985 HungryNow[2507:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView type]: unrecognized selector sent to instance 0x161bb960'
*** First throw call stack:
(0x1790012 0x149de7e 0x181b4bd 0x177fbbc 0x177f94e 0x1f401 0x2fe45 0x2ec6c 0x14b1705 0x4f2f4c 0x4f2fbc 0x41833f 0x418552 0x3f63aa 0x3e7cf8 0x27f2df9 0x27f2ad0 0x1705bf5 0x1705962 0x1736bb6 0x1735f44 0x1735e1b 0x27f17e3 0x27f1668 0x3e565c 0x24ad 0x23d5)
libc++abi.dylib: terminate called throwing an exception
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:09:20+00:00Added an answer on June 15, 2026 at 5:09 pm

    you are casting all your subviews to TOJDropableButtonView.

    But in reality, dro has some subviews that are not of TOJDropableButtonView class. And one of the subviews of dro happens to be an image view, which has no “type” property, which you are trying to access in your equalToString line.

    Make sure your subview of interest is of the class TOJDropableButtonView instead of type casting all subviews to TOJDropableButtonView.

    The code below should get rid of your issue.

    for (UIView *view in dro.subviews) {
        for (UIView *v in view.subviews) {
            if([v isKindOfClass:[TOJDropableButtonView class]]){
                if ([v.type isEqualToString:targetView.filterItem.searchFilterItem.type]){
                   NSLog(@"%@", targetView.filterItem.searchFilterItem.type);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does this for loop work with each condition on their own, but together
How does this condition work? I'm unable to comprehend this. if ([newLocation.timestamp timeIntervalSince1970] <
Assembly.GetEntryAssembly() does not work for web applications. But... I really need something like that.
i need to loop using timer and want to display the output, but the
I've the following condition in one of my model which works for mysql. with_scope
The normal implementations of a work queue I have seen involve mutexes and condition
Does MySQL regard brackets in the WHERE conditions at all? Does it work like
DISCLAIMER: Don't use ::feof() as your loop condition. For example, see the answer to:
I am trying to implement a simpler version of this algorithm but which works
I implemented an ExtensionMethod which basically works as ForEach-Loop, my Implementation looks like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.