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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:34:24+00:00 2026-05-23T10:34:24+00:00

i declared an int value as my imageIndexForSend through the following code in myView

  • 0

i declared an int value as my imageIndexForSend through the following code in myView class.

int imageIndexForSend; 
@property int imageIndexForSend;
@synthesize imageIndexForSend;

after on a button click i am displaying a popover which is PopOver calss.
there is table view with multiple indexes in popover class.when i click on any row in PopOver class table it set myView class imageIndexForSend as

In PopOver

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    myView *obj = [[myView alloc] init];
    [obj getImageForSend:indexPath.row];
    [staticSceneController release];
}

in myViewClass

-(void)getImageForSend:(int)index{
    imageIndexForSend = index;
}

then i am return to myViewClass after dismissing popover (popOver class) and doing some actions in myViewClass.

then i am clicking a send button.but the integer value imageIndexForSend is zero.cant get the old value which i set from PopUp.

can any one tell me a way to get the old imageIndexForSend value.may i know what mistake i done.

  • 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-23T10:34:24+00:00Added an answer on May 23, 2026 at 10:34 am

    First, you name a method with get to set the value, it’s bad.

    Second, you use a property and synthesize it, so you don’t need to rewrite the set method unless you need to have a custom set method.

    And finally you create a new view on each selection of tableview cell !

    1) Remove your getImageForSend: method, you don’t need that with property

    2) Instead using : [obj getImageForSend:indexPath.row];, use : obj.imageIndexForSend = indexPath.row;

    3) Don’t create a new view on each selection, assign the value on the existing view.

    A better way to transmit data from your popover to your view (controller ?) is to have a delegate property in your popover class and set it with your view object, create a delegate protocol with a method that is called when a cell is selected in popover with an int argument (the index) then make your view class adopts the protocol and do a obj.imageIndexForSend = argument; in your protocol method.

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

Sidebar

Related Questions

Given the following: declare @a table ( pkid int, value int ) declare @b
In my C# source code I may have declared integers as: int i =
I have declared: queue<int, list<int> > Q After a series of calls: Q.push(37); Q.pop();
Having the following generic class that would contain either string, int, float, long as
I have declared int value in my main, and all of the processes has
I recently ran across a class that had the following field declared: private final
I have a function that takes, amongst others, a parameter declared as int privateCount
In C, I have declared a memory area like this: int cells = 512;
I have a class which should be declared globally from main() and accessed from
I would like to define inside a class a constant which value is the

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.