Copy Nsobject into new one iOS objective C

 Solution:

You can use copywithzone function to create new entire nsobject and return it to your other class.You just call the NSObject.copy to get the entire copied object in iOS.

If you did before creating this method it will be crashed.If you use the above method you will be easily handle the copy of our nsobject.

Objective C:

Declare the method in .h file and implement it in .m file to access it in anywhere..

-(id)copyWithZone:(NSZone *)zone {

}

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift