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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:04:43+00:00 2026-05-27T20:04:43+00:00

So here’s some code that I’m having trouble with: //format the date to a

  • 0

So here’s some code that I’m having trouble with:

//format the date to a string for echoing it
    NSDateFormatter* formattedDate = [[NSDateFormatter alloc] init];
    [formattedDate setDateStyle:NSDateFormatterLongStyle]; //now myFormatted is set to a long style
    NSString* dateForOutput = [formattedDate stringFromDate:self.datePickerOutlet.date];
    //also now need to set the "you began on" text to the newly chosen date
    [self.startDate setText:@"You started on: %@", dateForOutput];

The error that is given is: “Too Many Arguments to method call, expected 1, have 2”

I don’t see why it’s saying that I’m trying to pass in two methods.
I tried to do the following in case I was being stupid but it still gave me an error:

//format the date to a string for echoing it
NSDateFormatter* formattedDate = [[NSDateFormatter alloc] init];
[formattedDate setDateStyle:NSDateFormatterLongStyle]; //now myFormatted is set to a long style
NSString* dateForOutput = [formattedDate stringFromDate:self.datePickerOutlet.date];
//also now need to set the "you began on" text to the newly chosen date
NSString *foobar = @"You started on: %@", dateForOutput;
[self.startDate setText:foobar];

Error given: “Interface type cannot be statically allocated”

Frankly I have no idea why it’s giving me this error… some help would be greatly appreciated.
It’s probably just something small that I’m just not seeing for some reason =/

cheers,
Matt

  • 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-27T20:04:44+00:00Added an answer on May 27, 2026 at 8:04 pm

    Instead of the line

    [self.startDate setText:@"You started on: %@", dateForOutput];
    

    in the first block of code you have given, try the following line

    [self.startDate setText:[NSString stringWithFormat:@"You started on: %@", dateForOutput]];
    

    But it is better to go with the second statements,

    NSString *foobar = [NSString stringWithFormat:@"You started on: %@", dateForOutput];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the issue I am having: I have a large query that needs
Here's some of my production code (I had to force line breaks): task =
Here is my code (Say we have a single button on the page that
Here's my situation. I've noticed that code gets harder to maintain when you keep
Here is some code I made :) @echo off set source=R:\Contracts\ set destination=R:\Contracts\Sites\ ROBOCOPY
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's my scenario - I have an SSIS job that depends on another prior
Here is my code, which takes two version identifiers in the form 1, 5,
Here's a coding problem for those that like this kind of thing. Let's see
Here is the scenario: I'm writing an app that will watch for any changes

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.