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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:06:10+00:00 2026-05-23T14:06:10+00:00

Iam pretty new to Objective c,Iam unable to add NSmutable array contents to NSarray

  • 0

Iam pretty new to Objective c,Iam unable to add NSmutable array contents to NSarray here.

    - (void)viewDidLoad {

    markarry=[[NSMutableArray alloc]init];

HolidayAppDelegate *delegatObj = (HolidayAppDelegate *)[UIApplication sharedApplication].delegate;

for (int i=0;i<[delegatObj.Datearray count]; i++) {

    NSString *Str=[delegatObj.Datearray objectAtIndex:i];


    NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"MMMM-dd-yyyy"];

    [dateFormatter setTimeZone:gmt];
    NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
    [dateFormatter setLocale:usLocale];
            NSDate *dateFromString;
    dateFromString = [dateFormatter dateFromString:Str];


    [markarry addObject:dateFromString];
    [dateFromString release];
    [Str release];

}


 }

I need to add markarry contents to the nsarray.
Thanks

  • 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-23T14:06:10+00:00Added an answer on May 23, 2026 at 2:06 pm

    Very Simple

    NSArray *newArray = [NSArray arrayWithArray:markarry];
    

    UPDATE

    Ok it seems your string is nil when you create it using dateformatter. Try to debug your app you will find the solution.[dateFormatter setDateFormat:@”MMMM-dd-yyyy”]; the format you are using here mmust be same as the string as. Otherwise you will get nil in your dateFromString object.

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

Sidebar

Related Questions

Pretty new (2 weeks) into Objective-C and Xcode, and I'm trying to add my
I'm pretty new to iPhone development and I'm still getting my head around Objective-C,
I am pretty new to Objective-C (so far I was working with .NET and
I am pretty new to TFS and source control. I unable to understand the
I am pretty new to Objective C, and even brand new to using SQL
I am pretty new to iPhone/Objective-c programming. I'm struggling with an issue that doesn't
I'm pretty new to Objective C, and I'm having trouble reading values from a
I'm still pretty new to Objective -C and iPhone development and am trying to
I'm still pretty new to Cocoa/Objective-C, so I hope I can explain my question.
I am pretty new to the NInject binding, and here is what NInject describes.

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.