---
title: "How does a Category Works in iOS?"  
description: "How does a Category Works in iOS?"  
author: "Anonymous User"  
published: 2016-01-05  
updated: 2016-01-05  
canonical: https://www.mindstick.com/forum/33835/how-does-a-category-works-in-ios  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# How does a Category Works in iOS?

I have created an [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) using Objective-C code. In my code I have a need for extending a [standard](https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard) class of a iOS [framework](https://www.mindstick.com/forum/34615/software-framework-vs-library) with an [instance variable](https://www.mindstick.com/forum/23344/multidimensional-array-of-nsinteger-as-instance-variable) plus accessors.\
I learn learn Apple's [developer](https://www.mindstick.com/articles/157260/variation-between-web-designer-and-web-developer) [documentation](https://answers.mindstick.com/qa/30462/what-is-documentation) about 'Category' and its sounds pretty confusing to me.\
\
Can [anyone tell me](https://www.mindstick.com/interview/23033/can-anyone-tell-me-about-hadoop-toolbox) the basic [functionality](https://www.mindstick.com/blog/136/using-watermark-functionality-in-textbox-by-jquery) of Category.\
Thankyou.

## Replies

### Reply by Tarun Kumar

Category is a unique feature in iOS because with this help we can add our custom methods inside our own classes or predefined classes means(framework classes).\
for example- I have created a custom method and I want to use this method anywhere in our Application. now at this condition we can add this method into any framework class using Category.

Now, if you need to add [instance](https://www.mindstick.com/forum/155658/testing-connection-to-cloud-sql-instance-with-a-mysql-client-from-vm-instance) variables to a class, a category would not do the job, categories only add methods not data.\
So, to add instance variables you must subclass.


---

Original Source: https://www.mindstick.com/forum/33835/how-does-a-category-works-in-ios

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
