So I've an Application with a ViewController Class and a NSObject Class. I've made my own mehtods. The view controller posts over that method a string to the nsobject class. The problem ist i only can log it with NSLog. I can't acces it only via NSLog.
ViewController.h :
Code:
#import <UIKit/UIKit.h>
#import "GetImages.h"
@interface EventsViewController : UIViewController {
NSString *testString;
}
@end
ViewController.m:
Code:
#import "EventsViewController.h"
@implementation EventsViewController
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
testString= @"test";
GetImages *gImages = [[GetImages alloc] init];
[gImages getFlyerImagesWithString:testString];
[super viewDidLoad];
}
@end
Now the Nsobject class .h:
Code:
#import <Foundation/Foundation.h>
#import "EventsViewController.h"
@interface GetImages : NSObject {
}
-(void)getFlyerImagesWithString:(NSString *)string;
@end
And .m :
Code:
#import "GetImages.h"
@implementation GetImages
-(void)getFlyerImagesWithString:(NSString *)string {
NSLog(@"%@",string);
}
@end
Do you know, how i can acces the string in the nsobject class? it only works via nslog