Reputation: 77
I have created a class from NSObject to save my information.
@interface MyInfor : NSObject
+(MyInfor *)Insert_MyName:(NSString *)MyName
MyAge:(NSString *)MyAge;
And now, I want to release memory for my class when it's not used.
How to I can do this.
Upvotes: 1
Views: 829
Reputation: 884
If ARC is enabled in your project (any newly created projects in the last years do have it enabled by default) there is no need to manually release the memory.
If ARC is not active you have to release the memory where you allocate it. You have to override "dealloc" to release any memory.
If you don't use ARC you should consider reading this: Memory Management
Upvotes: 1