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

  • Home
  • SEARCH
  • 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 4569402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:12:51+00:00 2026-05-21T19:12:51+00:00

I am sorry, as this question may have been asked before, but I could

  • 0

I am sorry, as this question may have been asked before, but I could not find an answer that worked in my situation.
I am new to Objective-C, and I am not entirely knowledgable, so I apologize beforehand in the case that I seem like I am not amazing 😉

So, I have a webView, and everyday, the url changes. Ex: on April 30th the url is http://example.com/mylinkApr30
Using dates, I made a variable (sorry if my terminology is off :\ ), and the url ends in %d everything works just fine, except when it comes to month. The months are not in the typical MM form, they are in a shortened text, with the three first letters of the month name. Ex: Jan, Feb, Mar, Apr, etc.

I have the month integer working, and it writes as 1,2,3 etc.
How should I go about changing that to Jan, Feb, Mar?

Is there a different way I could go about this??
I can confirm the days are working, I have tested it with having 1 variable, and using Apr at the end of the link.

Here is my code, so it is easier for you to understand what I am asking.

- (void)viewDidLoad
{    
[super viewDidLoad];
self.navigationItem.title = @"Balmoral";
NSCalendar *calendar= [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSCalendarUnit unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit |  
NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | 
NSSecondCalendarUnit;
NSDate *date = [NSDate date];
NSDateComponents *dateComponents = [calendar components:unitFlags fromDate:date];
//NSInteger year = [dateComponents year];
NSInteger month = [dateComponents month];
NSInteger day = [dateComponents day];
//NSInteger hour = [dateComponents hour];
//NSInteger minute = [dateComponents minute];
//NSInteger second = [dateComponents second]; 

NSString *baseURLStr = @"http://wwww.WebsiteHere.com/Apr";
NSURL *url = [NSURL URLWithString:[baseURLStr stringByAppendingFormat:@"%d.ashx", day]];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
[NSCalendar release];
}
  • 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-21T19:12:51+00:00Added an answer on May 21, 2026 at 7:12 pm

    Check out the NSDateFormatter class, something like:

    int month = 3;
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"MM"];
    NSDate *date = [formatter dateFromString:[NSString stringWithFormat:@"%02i", month]];
    [formatter setDateFormat:@"MMM"];
    NSString *monthString = [formatter stringFromDate:date];
    
    NSLog(@"MONTH STRING %@", monthString);
    

    monthString should be “Mar”

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

Sidebar

Related Questions

This question may have been asked before and I'm sorry if I missed it,
This may have been answered before, but I cannot find a solution that works.
Sorry, this may or may not be a programming question directly, but I am
Sorry if this question is very easy, but I can't find the answer anywhere.
Sorry if this question is answered already, but I didn't find a suitable answer.
Sorry if this question may be simple, but I can't seem to find an
Sorry if this question is too vague, but I'd rather not muddy it's point
Sorry if this question sounds a little silly, but I am not sure what
Ok, I know this has been asked a thousand times before, but no conclusive
Sorry in advance as this question is similar (but not the same!) to others.

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.