---
title: "NSCalendar  throwing error on ios 7"  
description: "NSCalendar  throwing error on ios 7"  
author: "Anonymous User"  
published: 2014-10-17  
updated: 2014-10-17  
canonical: https://www.mindstick.com/forum/2410/nscalendar-throwing-error-on-ios-7  
category: "iphone"  
tags: ["iphone", "ios", "ios 7"]  
reading_time: 1 minute  

---

# NSCalendar  throwing error on ios 7

I am creating my app with [Xcode](https://www.mindstick.com/blog/10962/required-resources-in-xcode-project) 6 and it [works fine](https://answers.mindstick.com/qa/115732/my-software-works-fine-on-windows-10-but-crashes-on-windows-11-why) on ios8. I just tested the app on ios7 and i get this [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing):\
Terminating app due to uncaught [exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling) 'NSInvalidArgumentException', reason: '+[NSCalendar calendarWithIdentifier:]: [unrecognized selector](https://www.mindstick.com/forum/23383/unrecognized-selector-when-setting-nsarray-property) sent to [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) 0x3a78418cThis is the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) i am using as part of converting [dates](https://yourviews.mindstick.com/story/1513/7-zodiac-signs-astrology-dates-meanings-amp-compatibility) from Gregorian [calendar](https://www.mindstick.com/articles/13088/how-to-choose-the-best-calendar-for-you-dynamics-crm-system) to Persian Calendar:\
NSCalendar *calendar = [NSCalendar calendarWithIdentifier:@"persian"];

## Replies

### Reply by Manoj Bhatt

The +[NSCalendar calendarWithIdentifier] class method is only available on iOS 8/OS X 10.9 and later.\
But you can use the designated initializer method instead, this works on all iOS releases:\

```
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:@"persian"];
```


---

Original Source: https://www.mindstick.com/forum/2410/nscalendar-throwing-error-on-ios-7

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
