Subscribe ( )

iPhone Programming Tutorials

 

Forum

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

You must be logged in to post Login Register

Search 

* Edit post * Delete post * Report this post * Reply with quote Showing Images an

User Post

4:31 pm
January 10, 2009


Bilgrami

Noob

posts 1

1

I want to show Images and Text simultaneously in one UIPickerView,

My UIPickerView has three component,

Component 1 showing text,
Component 2 showing text,
Component 3 showing images.

How to do that?. The examples contain either text or images but not both of them simultaneously.

Now I know that I have to use following method to show text, right?:

- (NSString *)pickerView:(UIPickerView *)pickerView
             titleForRow:(NSInteger)row
            forComponent:(NSInteger)component
{
    if (component == 0)
        return [self.states objectAtIndex:row];
    else if (component == 3)
     return nil;
   
    return [self.zips objectAtIndex:row];

}

and following if I have to show any images

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
          forComponent:(NSInteger)component reusingView:(UIView *)view
{
 if (component == 2)
    return [self.column3 objectAtIndex:row];   
return nil;
}

BTW,

states is an array contains strings.

Zips is an array containing string.

Coloumn3 is an array containing Images.


Need your help please.

Thanks,

Azhar Bilgrami


About the iCodeBlog forum

Currently Online:

4 Guests

Maximum Online: 44

Forums:

Groups: 2

Forums: 6

Topics: 320

Posts: 760

Members:

There are 678 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 54

crazyiez - 30

VertigoSol - 26

Uhu - 17

AdeC - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)