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

  • Home
  • SEARCH
  • 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 3878878
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:39:45+00:00 2026-05-19T22:39:45+00:00

is almost a week that i can’t fix a brain painful problem: I have

  • 0

is almost a week that i can’t fix a brain painful problem:

I have a UIViewController subclass named StreamingViewControllerCommon that implement this property:

@property (nonatomic, assign, readonly) BOOL isMusicStopped;

and of course i @synthesize it in the .m file

then i have 2 subclasses of this class: Listen_UIViewController and LastNews_UIViewController that modify (not calling self.isMusicStopped but accessing directly to it) the var isMusicStopped.

In another Class i have a NSMutableDictionary that contains 2 instance (1 for each class) of these two classes but when i try to do this:

if (streamingViews){
        for(StreamingViewControllerCommon* aView in streamingViews){
            BOOL stopped = aView.isMusicStopped;
            NSLog(@"%@",stopped);
            if(stopped){
                [aView closeStream];
                [streamingViews removeObjectForKey:[aView class]];
                [aView release];
                aView = nil;
            }
        }
    }

i obtain this error:

2011-02-08 15:55:09.760 ProjectName[6182:307] +[LastNews_UIViewController isMusicStopped]: unrecognized selector sent to class 0x2143c
2011-02-08 15:55:09.768 ProjectName[6182:307] CoreAnimation: ignoring exception: +[LastNews_UIViewController isMusicStopped]: unrecognized selector sent to class 0x2143c

But the weird thing is that in the StreamingViewControllerCommon implement also these methods:

-(void) destroyStreamer{
}

-(void) closeStream{
    [self destroyStreamer];
}

and when i do:

NSMutableArray* keys = [[NSMutableArray alloc] initWithArray:[streamingViews allKeys]];
    [keys removeObject:[thisView class]];
    NSMutableArray *tmp =  [[NSMutableArray alloc] initWithArray:[streamingViews objectsForKeys:keys notFoundMarker:@"404"]];
    if (tmp){
        for (StreamingViewControllerCommon* vc in tmp)
            [vc closeStream];
        [tmp release];
    }

    [streamingViews removeObjectsForKeys:keys];

i am not getting any error and the subclasse’s overridden closeStream methods are right called.

What am i doing wrong?

Best Regards, Antonio

EDIT: As I wrote in the comment: Changing this:

if (streamingViews){
        for(StreamingViewControllerCommon* aView in streamingViews){
            BOOL stopped = aView.isMusicStopped;
            NSLog(@"%@",stopped);
            if(stopped){
                [aView closeStream];
                [streamingViews removeObjectForKey:[aView class]];
                [aView release];
                aView = nil;
            }
        }
    }

in this:

if (streamingViews){
        for (id aViewClass in streamingViews){
            StreamingViewControllerCommon* aView = [[streamingViews objectForKey:aViewClass] retain]; 
            //NSLog(@"%@",aView.isMusicStopped);
            if(aView.isMusicStopped){
            [aView closeStream];
            [streamingViews removeObjectForKey:aViewClass];
            [aView release];
            aView = nil;
        }
    }
}

Did the trick 😛 The for each cycle of a NSDictionary returns its keys not the objects and, since i was using the Class of objects as key i was obtaining that weird 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-05-19T22:39:45+00:00Added an answer on May 19, 2026 at 10:39 pm

    For whatever reason, it looks like streamingViews contains not an instance of LastNews_UIViewController, but the class itself. That’s what the plus sign in +[LastNews_UIViewController isMusicStopped] signifies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’ve got a problem witch I’ve been trying to solve almost for a week
My web application crashes almost once a week due to not enought memory error.
Almost every Python web framework has a simple server that runs a wsgi application
In almost any Windows application, I notice that holding the mouse button down in
I have a configuration file that has variables and value separate by spaces. I
I have a mysql table with users and their weekly calendar. Every user can
I am almost finished with a task someone gave me that at first involved
Almost every Java book I read talks about using the interface as a way
Almost 5 years ago Joel Spolsky wrote this article, The Absolute Minimum Every Software
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring

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.