Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-20-2010, 04:24 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 2
DjSimon is on a distinguished road
Default Problem with Set and Get on 2 Classes

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
DjSimon is offline   Reply With Quote
Old 11-20-2010, 05:06 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

I'm not sure what you mean it only works via nslog?! What do you want to do with the string sent in the getFlyerImagesWithString method?

Also, a note on terminology, your classes are actually subclasses of UIViewController and NSObject, they're not actually those classes.
baja_yu is offline   Reply With Quote
Old 11-20-2010, 05:43 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 2
DjSimon is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
I'm not sure what you mean it only works via nslog?! What do you want to do with the string sent in the getFlyerImagesWithString method?

Also, a note on terminology, your classes are actually subclasses of UIViewController and NSObject, they're not actually those classes.
I want to use it for getting nsdata with string you know ?
but i can't acces the string the string isn't nil but i don't gives any data out you know ?
only nslog can read the string
sry for my bad english
DjSimon is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone sdk, nsobject, viewcontroller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 374
7 members and 367 guests
apatsufas, Kirkout, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:44 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0