Rectangle 27 0

ios how to share different urls via uiactivityviewcontroller?


- (id)item {
    NSString *activityType = self.activityType;

    if ([self.placeholderItem isKindOfClass:[NSString class]]) {

        if ([self.activityType isEqualToString:UIActivityTypePostToFacebook]) {

            self.url = kSHARELINK_FB;

        } else if ([activityType isEqualToString:UIActivityTypePostToTwitter]) {

            self.url = kSHARELINK_TWITTER;


        } else if ([activityType isEqualToString:UIActivityTypeMessage]) {

            self.url = kSHARELINK_SMS;


            } else if([activityType isEqualToString:UIActivityTypeMail]){
            self.url = kSHARELINK_EMAIL;


        }else if ([activityType isEqualToString:UIActivityTypePostToWeibo]){
            self.url = kSHARELINK_WEIBO;

        }else{

            self.url = kSHARELINK_OTHER;

        }
      return self.url;
    }

    return self.placeholderItem;
}

It turns out that I was missing a return self.url; ...

Note