3

I used this code to file the rows in my UIPickerView:

self.component1Data = [NSArray arrayWithObjects: @"Sample", @"Sample1", @"...", nil];

How can I get a NSString instead of the "sample"? I tried it with "%@" but it doesn't work:

self.component1Data = [NSArray arrayWithObjects: @"%@",string, @"%@",string2, @"...", nil];

1 Answer 1

14
self.component1Data = [NSArray arrayWithObjects: string, string2, nil];

Assuming string and string2 are of type NSString *.

Sign up to request clarification or add additional context in comments.

1 Comment

Haha, great :) It is to late.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.