I am using this link
as my CDTest.h and CDTest.m and in my TestAppDelegate.m i am calling these class with button action as
-(IBAction)Zipbtn:(id)sender{
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSLog(@"paths=%@",paths);
NSString* dPath = [paths objectAtIndex:0];
NSLog(@"dpaths=%@",dPath);
NSString* txtfile = [dPath stringByAppendingPathComponent:@"test.txt"];
NSLog(@"txtfile=%@",txtfile);
NSData* data=[txtfile dataUsingEncoding:NSUTF8StringEncoding];
NSLog(@"data=%@",data);
CDTest *obj=[[CDTest alloc]init];
[obj gzipData:data];
}
but showing
warning instance method -gzipData not found also on button click shows :-[CDTest gzipData:]: unrecognized selector sent to instance 0x7f8d7a009070
Please help me out as i am new to Mac osx.
The method is a class method – not an instance method. You should be using:
Additionally, you’re actually creating an NSData from the string when you do:
What you want to do is get the data from the content of the file, which is: