---
title: "Difference between NSInteger and NSUInteger"  
description: "Difference between NSInteger and NSUInteger"  
author: "Anonymous User"  
published: 2015-12-01  
updated: 2015-12-02  
canonical: https://www.mindstick.com/forum/33668/difference-between-nsinteger-and-nsuinteger  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Difference between NSInteger and NSUInteger

Can any one tell me the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between NSInteger and NSUInteger in Objective-C?

Which is better to use in an [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) and why it is better?

## Replies

### Reply by Tarun Kumar

You always be aware of integer conversion rules dealing with NSInteger and NSUInteger.\
For example: NSInteger can takes and returns negative values, and NSUInteger takes values and returns only unsigned values.

```
NSInteger nsinteger = -1;NSUInteger nsuinteger = 1;NSLog(@"%d",nsinteger<nsuinteger);
```


---

Original Source: https://www.mindstick.com/forum/33668/difference-between-nsinteger-and-nsuinteger

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
