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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:24:53+00:00 2026-05-28T16:24:53+00:00

I’m creating an instance of a class called S3ObjectController (S3OC) that has one method

  • 0

I’m creating an instance of a class called S3ObjectController (S3OC) that has one method and four delegate methods. I create an instance of my S3OC, call an instance method from the S3OC Class (which I know fires from NSLog statements) but none of the associated delegate methods are called within the S3OC class. I have the delegate set to self in the method and the delegate declared properly in the .h header.

Thoughts? just to be clear, it’s the (void)request methods in the .m file below I’m thinking should be called that aren’t. I’m getting EXC BAD ACCESS errors. Is self getting released by ARC?

The entire .m file of the S3OC class is below:

#import "S3ObjectController.h"

@implementation S3ObjectController
@synthesize string;
@synthesize s3GOR, s3Client;

-(void)method
{
    NSLog(@"Method Called");
    s3Client = [[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];
    s3GOR = [[S3GetObjectRequest alloc]initWithKey:string withBucket:[Constants pictureBucket]];
    [s3GOR setDelegate:self];
    [s3Client getObject:s3GOR];
    NSLog(@"Method Finished");
}

-(void)request:(AmazonServiceRequest *)request didFailWithError:(NSError *)error
{
    NSLog(@"Error %@",error);
}

-(void)request:(AmazonServiceRequest *)request didReceiveResponse:(NSURLResponse *)response 
{
    NSLog(@"Response Key %@", response);
}

-(void)request:(AmazonServiceRequest *)request didReceiveData:(NSData *)data
{
    NSLog(@"ObjectRequestKey = %@",request);
}

-(void)request:(AmazonServiceRequest *)request didCompleteWithResponse:(AmazonServiceResponse *)response
{
    NSLog(@"Final Delegate Method");
}

Here’s the header:”

@interface S3ObjectController : NSObject <AmazonServiceRequestDelegate>{
    NSMutableData *responseData;
    NSString *string;

    AmazonS3Client *s3Client;
    S3GetObjectRequest *s3GOR;
}

-(void)method;

@property (nonatomic, strong)  NSString *string;
@property (nonatomic, strong) S3GetObjectRequest *s3GOR;
@property (nonatomic, strong) AmazonS3Client *s3Client;

@end

Finally, here’s how I call the method in another class:

for (NSString *name in nameArray){
        @try {
            S3ObjectController *localS3 = [[S3ObjectController alloc]init];
            localS3.string = name;
            [localS3 method];
            NSLog(@"called");
}
  • 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-28T16:24:54+00:00Added an answer on May 28, 2026 at 4:24 pm

    I think your suspicions about ARC are true. Because delegate properties are usually weak references, they aren’t enough to keep the object from being released.

    Make an NSArray that’s an iVar and add the S3ObjectController to it. If the delegates still don’t fire, you know it’s something else…

    Edit:

    so declare an NSMutableArray in the header of the class that contains your for loop, initialize it somewhere like this:

    myArray = [NSMutableArray arrayWithCapacity:0];
    

    then use it like this:

    for (NSString *name in nameArray){
    @try {
            S3ObjectController *localS3 = [[S3ObjectController alloc]init];
            localS3.string = name;
            [localS3 method];
            [myArray addObject:localS3];
            NSLog(@"called");
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of 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.