" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi
Generally we think %@ represents NSString in objective c. Some people think %@ can be used in case of NSString only.
e.g. NSString* name = @"waseem";
Actually %@ works for Id i.e object of class type NSObject. It means %@ can represent object NSArray, NSDictionary and so on. So we can use it like this also.
NSDictionary* dict = [NSDictionarydictionaryWithObject:@"waseem"forKey:name];
Whenever we write %@, compiler calls NSObject object method description. It means whenever we write NSString, It calls description method again and it print/display string value.
Mail (will not be published) (required)
Enter Captcha Code *
− four = 2
Burn Ignorance is a knowledge initiative by Mindfire Solutions
Subscribe to our mailing list to get the updates to your email inbox...