Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Store two URL fields in the same entity? #85

Open
marcelosalloum opened this issue Jan 20, 2015 · 0 comments
Open

How to Store two URL fields in the same entity? #85

marcelosalloum opened this issue Jan 20, 2015 · 0 comments

Comments

@marcelosalloum
Copy link

Hi guys, this is actually a question rather than an issue. I have a Content entity that has two fields that contain an URL, they are photo_url and photo_thumb_url.

It seems to be possible by overwrite both *- (NSString )sourceImageUUID and **- (NSURL )sourceImageURLWithFormatName:(NSString )formatName methods but I am not sure how. Would something like the code bellow work? If not, do you have any suggestions?

- (NSString *)UUID {
    CFUUIDBytes UUIDBytes = FICUUIDBytesFromMD5HashOfString(_userID);
    NSString *UUID = FICStringWithUUIDBytes(UUIDBytes);

    return UUID;
}

- (NSString *)sourceImageUUID {   
    return [self UUID];
}

- (NSURL *)sourceImageURLWithFormatName:(NSString *)formatName {   
    if ([formatName isEqualToString:@"thumbnail"]) {
        return self.photo_thumb_url;
    } else {
        return self.photo_url;
    }
}

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant