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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:19:09+00:00 2026-05-28T20:19:09+00:00

I am trying to call a method that returns an object and need help

  • 0

I am trying to call a method that returns an object and need help as I am getting a EXC_BAD_ACCESS when it is called. I am trying to get a QuoteMap object returned to the ViewController that calls it.

The method is addAndReturnQuoteMap which is as declared in the header QuoteMap.h

- (QuoteMap *)addAndReturnQuoteMap:(NSString *)subId withQuoteId:(NSString *)quoteId;

The method itself looks like this:

- (QuoteMap *)addAndReturnQuoteMap:(NSString *)subId withQuoteId:(NSString *)quoteId {

//FIRST GET A NEW QUOTE_MAP_ID

NSInteger newQuoteMapId = self.getNextQuoteMapId;
NSLog(@"newQuoteMapId = %d", newQuoteMapId);

// THEN TAKE THE QUOTE_MAP_ID, SUBJECT_ID AND QUOTE_ID AND INSERT INTO QUOTE_MAP TABLE

NSLog(@"subId = %@   quoteId = %@", subId, quoteId);

QuotesAppDelegate *appDelegate = (QuotesAppDelegate *)[[UIApplication sharedApplication] delegate];
FMDatabase *database = [FMDatabase databaseWithPath:appDelegate.getDBPath];    

if ([database open]) {
    [database executeUpdate:@"insert into QUOTE_MAP(quote_map_id, quote_id, subject_id) values(?, ?, ?)", 
     newQuoteMapId, subId, quoteId];

    [database close];
}

[database open];

FMResultSet *result_categories = [database executeQuery:@"select * from QUOTE where quote_id = 835"];
[result_categories next];

QuoteMap *qm = [QuoteMap alloc];
qm.quote_map_id = [result_categories stringForColumn:@"QUOTE_MAP_ID"];
qm.quote_id = [result_categories stringForColumn:@"QUOTE_ID"];
qm.subject_id = [result_categories stringForColumn:@"SUBJECT_ID"];
qm.isDirty = NO;

NSLog(@"QuoteMap inserted the quote_map_id of: %@", qm.quote_map_id);
[qm release];

return qm;

};

I call the method from my AddQuoteViewController here:

    [qm addAndReturnQuoteMap:mySubjectId withQuoteId:quote.quote_id];

I am sure there is something really stupid that I am doing wrong and would appreciate any direction on what that might me.

  • 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-28T20:19:10+00:00Added an answer on May 28, 2026 at 8:19 pm

    You’re not calling init on your QuoteMap. It should be:

    QuoteMap *qm = [[QuoteMap alloc] init];
    

    There is no case where you should call a bare +alloc without immediately calling some form of -init.

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

Sidebar

Related Questions

I'm trying to call a Sort method that expects a parameter of type IComparer<object>
I am working with ASP.net. I am trying to call a method that exists
I'm trying to get a simple Java method call from C++ while Java calls
I'm trying to write a method that will return a Hibernate object based on
I created an HtmlHelper method called DisplayListBoxFor that will need display a textual representation
I'm trying to add a method to a jQuery object that has the same
I am trying to call the .ajax() method when a button with id=go is
I'm trying to call a Page Method using a jQuery 'attached' event function, in
i am trying to call a navite method defined in c++ from java, the
I'm trying to intercept a method call (afterInsert() of a domain class) in 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.