I'm a bit confused with a tutorial I'm studying. There is a line of code that look like this:
location.photoId = @([Location nextPhotoId]);
Im not understand meaning of @()
syntax, what is it? There is definition of variables used in this statement:
@interface Location : NSManagedObject <MKAnnotation>
Location *location = nil;
@property (nonatomic, retain) NSNumber *photoId;
Declared in Location class.
+(NSInteger)nextPhotoId{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger photoId = [defaults integerForKey:@"PhotoId"];
[defaults setInteger:photoId+1 forKey:@"PhotoId"];
[defaults synchronize];
return photoId;
}
Class method in Location class.
Maybe its not necessary to paste that code here, but I think I should make it clearer. I only wish to know what @([Location nextPhotoId])
mean in that case, and what @()
stand for?
Any help would be appreciated!