views:

592

answers:

1

Hi, I've put UIsegment Control in my IPhone application.To load the pages I've this function - (void) segmentSelected:(id)segmentedCntl{ NSLog(@"Selected Segment Index = %d", [segmentedCntl selectedSegmentIndex]); int index = [segmentedCntl selectedSegmentIndex];

ViewController *viewController = (ViewController *) controller;
NSString *xPath = [NSString stringWithFormat:@"item[%d]/a", (index + 1)];
NSArray *items = [element nodesForXPath:xPath error:nil];
if([items count] > 0){
 CXMLElement *itemElement = (CXMLElement *) [items objectAtIndex:0];
 NSString *url = [[itemElement attributeForName:@"href"] stringValue];
 NSLog(@"url is &&&&&&&&&&&&&&&& %@", url);
 if([url startsWith:@"#"]){
 }else{
  NSString *fullURL = [URLLoader getURL:url];
  if(fullURL != nil){
   if([fullURL contains:@"?"]){
    fullURL = [fullURL stringByAppendingString:@"&iPhoneMode=app"];
   }else{
    fullURL = [fullURL stringByAppendingString:@"?iPhoneMode=app"];
   }
   [viewController showURL:fullURL cacheDuration:kPageCacheDuartion];     
  }
 }
}

}

But the segmentControl is not clickable.Please help me to solve this problem

A: 

Namastey saikamesh

Please check proper u'r UISegmentControl property setting it will be working.

RRB