I have a string value I set with a -void
method I need to retrieve that string in a class method +
I can't change +
to -
method so I need to figure out another way to retrieve that string.
@synthesize folderPathName=_folderPathName;
-(void)loadFolderPathName:(NSString *)folder{
_folderPathName=[[NSString alloc] initWithString:folder];
}
+(NSString *)getDocumentsDirectory
{
// NSString *pathwithFoldername=[NSString stringWithFormat:@"Documents/%@",_folderPathName];
NSString *documentsDirectory = [NSHomeDirectory()
stringByAppendingPathComponent:pathwithFoldername];
return documentsDirectory;
}
I have tried something like
-(NSString *) getFolderPathName{
return _folderPathName;
}
but neither this
NSString *pathwithFoldername=[FileUtils getFolderPathName];
or this allowed function calls
NSString *pathwithFoldername=[self getFolderPathName];
How can I get that string and use it in a + method?