i am new to ios and objected C.
I am trying to encode a url, bit i am getting the error
/Users/zupportdesk/Desktop/MyIOSApps/ZDticketSystem/ZDticketSystem/ViewController.m:313:52: No visible @interface for 'NSString' declares the selector 'URLEncodeUsingEncoding:'
#import "ViewController.h"
#import "AppDelegate.h"
#import "ApplicationEnvironmentURL.h"
#import "AFNetworking/AFNetworking.h"
#import "HHAlertView/HHAlertView.h"
#import "MBProgressHUD/MBProgressHUD.h"
#import "AppDelegate.h"
@interface ViewController ()<UITextFieldDelegate, UIActionSheetDelegate> {
ApplicationEnvironmentURL *applicationEnvironment;
NSString *BASEURL;
NSString *global_profileId;
AppDelegate *delegate;
}
@property (nonatomic, strong) NSString *username;
@property (nonatomic, strong) NSString *password;
@end
@implementation ViewController
--- defaults methods here
- (void)setupProfileidURL:(NSString *)profileToken {
NSString *encoded_profileToken = [profileToken URLEncodeUsingEncoding:NSUTF8StringEncoding];
NSString *user_login_url = [applicationEnvironment get_user_api_url];
BASEURL = [[user_login_url stringByAppendingString:@"Account/GetProfileDetails?profileToken="] stringByAppendingString:encoded_profileToken];
NSLog(@"Base URL: %@", BASEURL);
}
I am calling the method like this
[self setupProfileidURL:profileToken];
View Holder header file
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *tv_username;
@property (weak, nonatomic) IBOutlet UITextField *tv_password;
@end
I want to implement this https://madebymany.com/blog/url-encoding-an-nsstring-on-ios . can some one help me with this url encoding.