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 3948028
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:19:33+00:00 2026-05-20T01:19:33+00:00

i am developing an iphone application in which i have 3 classes => main

  • 0

i am developing an iphone application in which i have 3 classes => main class , abc class, pqr class. On main view , i have imageview on which i am displaying image. when user touch at the center of image on main view , new view will be pushed (depending on condition mentioned below)

a) if user came from abc view then
new view will not be pushed

b) if user came from pqr view then i
have to push new view .

My problem is how can i detect from which view user came to main view.

I create 1 class in which i have following code in .h file

typedef enum {
        abcViewSelected,
        pqrViewSelected
} SelectedViewType;

@interface Enumeration : NSObject {
    SelectedViewType selectedViewType;
}

@property(nonatomic) SelectedViewType selectedViewType;

In . m file i have

@synthesize selectedViewType;

When user select table cell from abcView & pqrView , i am pushing main view & setting view type in didSelectRowAtIndexPath as follows :-

enumObj.selectedViewType = abcViewSelected;

enumObj.selectedViewType = pqrViewSelected;

In main view’s touchBegan method i am compairing which view is selected by writing this

if(enum.selectedViewType == pqrViewSelected) => push new view 

else do nothing.

But this is not compairing & in none of case new view is pushed. I have imported all the required header files everywhere.

Plz help me ….Thanks in advance.

  • 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-20T01:19:34+00:00Added an answer on May 20, 2026 at 1:19 am

    The problem must be in this line:

    if(enum.selectedViewType = pqrViewSelected)
    

    Here you do not compare current type value, but rather assign pqrViewSelected to it (you have ‘=’ instead of ‘==’). Try changing that line to:

    if(pqrViewSelected == enum.selectedViewType){
        // push view
    }
    

    Note that having constant expression as first parameter in comparison makes it impossible to mistakingly use assignment (‘=’) instead of comparison (‘==’).

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

Sidebar

Related Questions

I am developing an iphone application which have a complicated view is to display
I am developing an iPhone application in which I have a page in which
i am developing an iphone application in which i want to apply table view
I am developing an iPhone application in which camera image store in NSData through
i am developing a iphone application in a view-based project,(not navigation) however i would
I am developing Iphone application. I have used SecKeyGeneratePair method of Security/Security.h framework. I
I am currently developing an iPhone application which loads data from an RSS feed
I'm developing an iPhone application which uses a TableView to display XML data. The
I am developing an iPhone application in which I am loading lots of data
I am developing an iPhone application in which I am fetching data from a

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.