Subscribe ( )

iPhone Programming Tutorials


 

Forum

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

Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

7 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.