0
votes

How would I init an NSString with a NSDictionary object? Currently, im using this:
(string is already declared)
string = [NSString stringWithFormat:@"%@", [attributeDict objectForKey:@"id"]];


This works fine as I can NSLog it and everything, however, I cannot pass it to another method for some reason. I have tried doing it with a class named controller like this:
[controller externalEchoString:string] In controller there is a method named externalEchoString:

-(void) externalEchoString:(NSString *) test{
NSLog(@"%@", test);
}

For some reason it fails to NSLog the string.... Any ideas?

1
I'm afraid you don't know what you're doing. - Hot Licks
hahaha, yeah I second that.. - Rob
I did do it once... I cant for the life of me remember what I did to succeed.... Im very tired so youl have to excuse my ignorance haha - James Heald
Look for any of about 100 "how do I pass parameters between classes/view controllers" questions. - Hot Licks

1 Answers

-1
votes

Solution: Call the method like this:

[ClassName methodName:[NSString stringWithFormat:@"%@", [dicthere objectForKey:@"id"]]];