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

The Archive Base Latest Questions

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

So, I develop the app that uses sqlite3 database methods. I have several view

  • 0

So, I develop the app that uses sqlite3 database methods. I have several view controllers so I decided to create a separate class for database methods. I called it DataBaseController.

When I try to load it in my app delegate and view controllers like this:

@class DataBaseController;

@interface FirstViewController : UIViewController {
DataBaseController *dataBaseController;
}
@property (nonatomic, retain) DataBaseController *dataBaseController;
@end

and then I implement it in FirstViewController.m. But when I try to call in AppDelegate, FirstViewController.m and other controllers the methods I implemented in DataBaseController, for example like:

#import "DataBaseController.h"
...
@synthesize dataBaseController;
...
-(void)ViewDidLoad {
[self.dataBaseController openDB];
[self.dataBaseController getRowsFromTable];
[super ViewDidLoad];
}

it works only in AppDelegate.

Please, suggest me any ideas on my problem. 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-26T10:57:34+00:00Added an answer on May 26, 2026 at 10:57 am

    I think you have to initialize the object.
    Your DataBaseController has an function called init right? Thats also a good place to open your database file.

    Than do:

    self.dataBaseController = [[[DataBaseController alloc] init] autoreleas];
    NSMutableArray *objs = [self.dataBaseController getRowsFromTable];
    

    dont forget to set your object to nill in your dealloc / viewdidunload if you make create a property.

    Hope this helps you out.

    Rolf

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

Sidebar

Related Questions

I have to developp an app that uses Push Notification in a particular way,
Is it a good practice to develop an app that uses the full screen?
I develop desktop-based WPF-application, that uses SQL Server 2008 R2 Database and ADO.NET Entity
I'm trying to develop an app that uses opengl on android, and ideally make
I want to develop an iOS app that uses an external hardware plug-in, kind
I am trying to develop a web app with eclipse that uses a derby
I need to develop an app that has the share function. I have to
I need to develop an app that is using multithreading. Basicly, I have a
I have a client that want to have us develop an app that will
Is there any way where i could develop an app that uses a Tree-structure

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.