Friday, 10 July 2015

Accessory Type in IOS

Accessory Type In IOS

Learn initialisers and getter and setter in Swift:Click here

Learn Objective C from here:Click here

Learn Swift From Here:Click Here

Learn IOS from Here:Click here

Learn Last tutorial of table view in IOS:Click Here

Learn from Other Site:Click Here

There are total following types of accessory view in IOS:

1.)Checkmark
2.)DetailDisclosureButton
3.)DetailButton
4.)DisclosureIndicator

Why we use Accessory Type in IOS?

Accessary View are predefined views for general Cell Structure at right hand side of cell. It is used to Access the value from Cell.
If you use Checkmark it will record all those rows which are selected. If you use Disclosure Indicator it shows you Selection of previous row and link to next table view Controller. If you use DetailDisclosureButton it shows next result in Detail View.



Lets look up each example of IOS accessory Type in IOS


For CheckMark:



For DetailButton:


For DetailDisclosureIndicator:


For DisclosureIndicator:




Have you read my last tutorial of Handling of Row Selection First Read It from here:Click here

Just modification of DidSelectRowAtIndexPath Method after 

[alert show];

write 

UITableViewCell *cell=[tableview CellForRowAtIndexPath:index path];

cell.accessoryType=UITableViewCellAccessoryCheckmark;


Just change DisclosureIndicator,DetailButton  etc. At Checkmark.

Now look up the DidSelectRowAtIndexPath method

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *st=[studentdata objectAtIndex:indexPath.row];
    NSString *str=[NSString stringWithFormat:@"The name of student is:%@",st];
    
    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"StudentName" message:str delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
    [alert show];
    UITableViewCell *cell=[tableView cellForRowAtIndexPath:indexPath];
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
   
}


I hope you like my tutorials.If you have any query comment here or mail me.

My Next tutorial will be Attractive Table View In IOS.








1 comment:

  1. Hey! This is my first visit to your blog! We are
    a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!

    Hire Affordable Xamarin Developer
    Xamarin Developers in Frisco

    ReplyDelete