Copy to Clip Board

  NSString *str=[[NSStringalloc]init];

        str=[[dataDicobjectForKey:@”BILL_TO”] objectForKey:@”ADDRESS”];

        NSCharacterSet *doNotWant = [NSCharacterSetcharacterSetWithCharactersInString:@”-/:;()$&@\”.,?!\'[]{}#%^*+=_|~<>€£¥•.”];

        str = [[str componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @””];

        NSLog(@”String is: %@”, str);

      //  str=[str stringByAppendingString:[NSString stringWithFormat:@”\n%@”,[dataDic objectForKey:@”BILL_TO”]]];

        str = [str stringByAppendingString:[NSStringstringWithFormat:@”\n%@”,[[[dataDicobjectForKey:@”BILL_TO”] objectForKey:@”BILL_TO”] objectForKey:@”FIRST”] ]];

        str = [str stringByAppendingString:[NSStringstringWithFormat:@”\n%@”,[[[dataDicobjectForKey:@”BILL_TO”] objectForKey:@”BILL_TO”] objectForKey:@”LAST”] ]];

        str = [str stringByAppendingString:[NSStringstringWithFormat:@”\n%@”,[[dataDicobjectForKey:@”BILL_TO”] objectForKey:@”Company”]]];

        str = [str stringByAppendingString:[NSStringstringWithFormat:@”\n%@”,[[dataDicobjectForKey:@”BILL_TO”] objectForKey:@”PHONE”]]];

        UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];

        pasteboard.string=str;

        NSLog(@”%@”,pasteboard.string);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s