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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:41:57+00:00 2026-05-26T08:41:57+00:00

I am a new Programmer of Iphone….. i have a little problem in accessing

  • 0

I am a new Programmer of Iphone….. i have a little problem in accessing the NSMuttable array in my programe…

i am generating a view programmatically on button click …. code on button click is

-(IBAction)buttonClicked
    {
    secondView=[[TabBarSearchSecondView alloc]init];
    [myView addSubview:secondView.view];
}

inTabBarSearchSecondView .h file…..

@interface ......

NSMuttableArray *searchResult;

@end

@property (nonatomic,retain)NSMuttableArray *searchResult;

in TabBarSearchSecondView .m file………

@synthesize searchResult;


- (void)loadView
{


    CGRect cgRct = CGRectMake(0.0, 0.0, 480, 320); //define size and position of view 

    myView = [[UIView alloc] initWithFrame:cgRct]; //initilize the view    


    //open database

    DbOpenAndClose *dbObject=[[DbOpenAndClose alloc]init];
    [dbObject openDatabase];


    //for call of search showroom

    SearchProduct *object=[[SearchProduct alloc]init];

    searchResult=[object searchShowrooms:productname:cityname];

    [dbObject closeDatabase];


        count=[searchResult count];/// print 3 because 3 record match in database


    UITableView *table=[[UITableView alloc]initWithFrame:CGRectMake(4,80,312,325)        style:UITableViewStylePlain];

    //table.delegate=self;

    table.dataSource=self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    //NSLog(@"%i", [searchResult count]);

    return [searchResult count]; ///Not accessible here...Application Crash Here...
}

thanks for giving your valueable time for my Code…… 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-26T08:41:57+00:00Added an answer on May 26, 2026 at 8:41 am

    you have to retain the searchResult array….

    after this code

        searchResult=[object searchShowrooms:productname:cityname];
    

    retain the searchResult. otherwise it is released.. retain the searchResult like this.

    [searchResult retain];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m a new iPhone programmer I have created some small views without delegates.... If
i am a new iphone programmer i want to create an array that keeps
New Programmer here. Trying space invaders. I have a 2 dimensional array of objects
I am a new programmer... i have following problem.. Terminating app due to uncaught
I am a very new programmer, I have made a couple basic applications, however
We have 2 new GIS programmer/analyst in our department (new to programming and ArcObjects)
I'm a new Python programmer who is having a little trouble using 'self' in
hi i am new iphone programmer i want to know that can we create
hi i am a new iphone programmer i am creating a imagedisplay type application
I am a new programmer who is new to iPhone development and server stuff.

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.