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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:48:55+00:00 2026-05-24T13:48:55+00:00

I get the warning Argument in message expression is an uninitialized value in the

  • 0

I get the warning Argument in message expression is an uninitialized value in the bolded line below:

***SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share")***
                                                      delegate:as
                                             cancelButtonTitle:nil
                                        destructiveButtonTitle:nil
                                             otherButtonTitles:nil];
    as.item = [[[SHKItem alloc] init] autorelease];
    as.item.shareType = type;

Any ideas whats wrong or how I can fix it?
P.S – This is in ShareKit

Thanks!

Edit1: So you’re saying to do this?

+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type
{
    SHKItem *myItem = [SHKItem text:@"Share"];  // See SHKItem for other convenience constructors for URL, image, text and file item types.
    SHKActionSheet *as = [SHKActionSheet actionSheetForItem:myItem];
    as.item.shareType = type;

    as.sharers = [NSMutableArray arrayWithCapacity:0];
    NSArray *favoriteSharers = [SHK favoriteSharersForType:type];

    // Add buttons for each favorite sharer
    id class;
    for(NSString *sharerId in favoriteSharers)
    {
        class = NSClassFromString(sharerId);
        if ([class canShare])
        {
            [as addButtonWithTitle: [class sharerTitle] ];
            [as.sharers addObject:sharerId];
        }
    }

    // Add More button
    [as addButtonWithTitle:SHKLocalizedString(@"More...")];

    // Add Cancel button
    [as addButtonWithTitle:SHKLocalizedString(@"Cancel")];
    as.cancelButtonIndex = as.numberOfButtons -1;

    return [as autorelease];
}

Edit2:

+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type
{

    SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share")
                                                      delegate:nil
                                             cancelButtonTitle:nil
                                        destructiveButtonTitle:nil
                                             otherButtonTitles:nil];
    as.item = [[[SHKItem alloc] init] autorelease];
    as.delegate = self;


    as.item.shareType = type;

    as.sharers = [NSMutableArray arrayWithCapacity:0];
    NSArray *favoriteSharers = [SHK favoriteSharersForType:type];

    // Add buttons for each favorite sharer
    id class;
    for(NSString *sharerId in favoriteSharers)
    {
        class = NSClassFromString(sharerId);
        if ([class canShare])
        {
            [as addButtonWithTitle: [class sharerTitle] ];
            [as.sharers addObject:sharerId];
        }
    }

    // Add More button
    [as addButtonWithTitle:SHKLocalizedString(@"More...")];

    // Add Cancel button
    [as addButtonWithTitle:SHKLocalizedString(@"Cancel")];
    as.cancelButtonIndex = as.numberOfButtons -1;

    return [as autorelease];
}
  • 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-24T13:48:56+00:00Added an answer on May 24, 2026 at 1:48 pm

    I’m pretty sure the problem is on this line:

    delegate:as
    

    the problem is you are setting delegate to ‘as’ which is the name of the action sheet you are in the process of initialising. (so you are trying to pass a ref to an object you are in the process of initialising as an argument to its initialiser).

    Instead set the delegate to nil on the alloc/init call and explicitly set the delegate after the call.

    SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share")***
                                        delegate:nil
                                        cancelButtonTitle:nil
                                        destructiveButtonTitle:nil
                                        otherButtonTitles:nil];
    as.delegate = as;
    as.item = [[[SHKItem alloc] init] autorelease];
    as.item.shareType = type;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the warning childNodes is null or not an object' with different line
When debugging I get an warning message on exception saying 'variable info not available
im working on a old code and i have this warning message: Passed-by-value struct
I'm getting the following error message: Warning: Missing argument 7 for slider_getinfo_by_term(), called in
I recently started Erlang, and I notice I constantly get Warning: variable X is
I get this warning from GCC: warning: cannot pass objects of non-POD type 'class
The exact warning I get is warning C4715: 'hand::show' : not all control paths
I get a warning in MSVC++ when I try to read an integer from
I get the warning warning, -s option given but default rule can be matched
I get this: Warning: session_start(): Cannot send session cookie - headers already sent by

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.