File tree 1 file changed +4
-16
lines changed
1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,9 @@ + (void)emailTo:(NSString*)address
9
9
subject : (NSString *)subject
10
10
body : (NSString *)body {
11
11
NSString * mailtoString = [NSString stringWithFormat: @" mailto:%@ ?subject=%@ &body=%@ " ,
12
- (NSString *)[(NSString *)CFURLCreateStringByAddingPercentEscapes (
13
- NULL ,
14
- (CFStringRef )address,
15
- NULL ,
16
- CFSTR (" &" ),
17
- kCFStringEncodingUTF8 ) autorelease ],
18
- (NSString *)[(NSString *)CFURLCreateStringByAddingPercentEscapes (NULL ,
19
- (CFStringRef )subject,
20
- NULL , CFSTR (" &" ),
21
- kCFStringEncodingUTF8 ) autorelease ],
22
- (NSString *)[(NSString *)CFURLCreateStringByAddingPercentEscapes (NULL ,
23
- (CFStringRef )body,
24
- NULL ,
25
- CFSTR (" &" ),
26
- kCFStringEncodingUTF8 ) autorelease ]] ;
12
+ [address stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet ]],
13
+ [subject stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet ]],
14
+ [body stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLQueryAllowedCharacterSet ]]] ;
27
15
28
16
// Create an email message in user's default email client
29
17
NSURL * mailtoURL = [NSURL URLWithString: mailtoString] ;
@@ -56,4 +44,4 @@ + (void)emailTo:(NSString*)address
56
44
}
57
45
}
58
46
59
- @end
47
+ @end
You can’t perform that action at this time.
0 commit comments