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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:20:19+00:00 2026-05-23T09:20:19+00:00

This issue has been bugging me for a while now and somehow I cannot

  • 0

This issue has been bugging me for a while now and somehow I cannot find what I’m doing wrong. I must say I am new to Objective-C and Xcode.

So the issue is that I try to declare an instance variable (NSMutableArray) but for some reason the init function is NEVER reached. The variable is always NULL.

So I have a class named PropertyProvider which contains a NSMutableArray named “properties”.

@interface PropertyProvider : NSObject {
    NSMutableArray *properties;
}

@property (nonatomic, retain) NSMutableArray *properties;

..

@end

I then instantiate this NSMutableArray in the init method of this PropertyProvider class as the following:

@implementation PropertyProvider

@synthesize properties;

- (id) init {
    self = [super init];

    NSLog(@"Instantiating PropertyProvider");

    if (self) {
        properties = [[NSMutableArray alloc] init];
    }

    return self;
}

.. more code ..

@end

In my Application delegate I try to instantiate the PropertyProvider as “prp”:

@implementation MyAppDelegate

@synthesize prp = _prp;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [[_prp init] alloc];
    [self.window makeKeyAndVisible];
    return YES;
}

.. more code ..

- (void)dealloc
{
    [_prp release];
    [super dealloc];
}

But thus, for some reason it never reaches the init method of my PropertyProvider. Why o why?!

Thanks for your help!

  • 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-23T09:20:20+00:00Added an answer on May 23, 2026 at 9:20 am

    The correct way of initializing _prp as an instance of PropertyProvider would be,

    _prp = [[PropertyProvider alloc] init];
    

    Since _prp is an instance variable, it is nil by default and hence messages to it don’t do anything which is the reason why you’re not getting any errors.

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

Sidebar

Related Questions

I'm having a major issue which has been bugging me for a while now.
This one has been bugging me for a while now. Is there a way
This issue has been bugging me for the past several days. I've been working
I know this issue has been touched on here but I have not found
This has been a rather problematic issue on numerous occasions. We have alot of
This is driving me crazy, and has been bugging me for weeks, I'm trying
Greetings all, I realize this issue has been posed before in other forms, and
I've had an issue with Visual Studio that has been bugging me for some
This issue has been very hard for me to debug. I am a pc
I hope someone can help... This issue has been discussed here and I have

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.