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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:51:56+00:00 2026-06-18T07:51:56+00:00

I am using below code. NSString * weekdayString = [[self date] descriptionWithLocale:@%A]; NSLocale *usLocale

  • 0

I am using below code.

NSString * weekdayString = [[self date] descriptionWithLocale:@"%A"];
NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setLocale:usLocale];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
dateString = [NSString stringWithFormat:@"%@,%@",weekdayString,[dateFormatter stringFromDate:[self date]]];
NSArray * components = [dateString componentsSeparatedByString:@","];
dateString = [NSString stringWithFormat:@"%@,%@",[components objectAtIndex:0],[components objectAtIndex:1]];

it’s working fine in simulator and ios 6.0 but it’s not showing as expected in ios 5.1 in device(iPad).

  • 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-06-18T07:51:58+00:00Added an answer on June 18, 2026 at 7:51 am

    NSDate -descriptionWithLocale is documented to take an NSLocale; you’re passing an NSString and therefore relying on undocumented behaviour.

    It’s also unclear what you’re trying to achieve with the splitting into components — presumably you’ve assumed that the NSDateFormatterShortStyle will always have a comma in it? That also isn’t guaranteed by the documentation.

    What you probably want to do is just set a custom date format string. From the title of your post it looks like you probably want EEEE, MMMM dd. So e.g.

    // see QA1480 re: en_US_POSIX
    NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setLocale:usLocale];
    [dateFormatter setDateFormat:@"EEEE, MMMM dd"];
    dateString = [dateFormatter stringFromDate:[self date]];
    

    QA1480 addresses an issue that can cause NSDateFormatter silently to adapt your date formatter internally.

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

Sidebar

Related Questions

I am using the code below to switch to a language: -(void) switchToLanguage:(NSString *)lang{
I am able to call from my iphone application by using below code: NSString
I'm successfully making a ASIFormDataRequest using the below code. //get groups if (![self queue])
I am deleting all data from the table by using below code snippet NSString
how can I pass NSString value to webwhatsnew subview using below code . Thanks
If I make an NSString using the code below, do I need to need
I am using below code to upload excel and INSERT in mysql in php
I am using below code to get profile image of friends using Resfb. I
I am using below code to generate photo gallery from a folder. How can
I'm using below code to check some form fields and render datatable table on

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.