read To Recipients in MFMailComposer - iphone

I want to save, after user press send mail button, the mail addresses an user wrote. But even if it could be set the to recipient I don't know how to read from it (there aren't any properties, or better any read enabled one, related to toRecipient). Any suggestions?

I don't think there is any way to do that.

I find a way:
Code
MFMailComposeViewController *mViewController = [[MFMailComposeViewController alloc] init];
NSArray* listVues = [mViewController childViewControllers];
MFMailComposeViewController* mailContainer = [listVues objectAtIndex:0];
UIView* mailView = [[[mailContainer view] subviews] objectAtIndex:0];
UIScrollView* composer = [[mailView subviews] objectAtIndex:0];
UIView* composerFields = [[composer subviews] objectAtIndex:0];
for (UIView* item in [composerFields subviews])
{
NSString* desc = [item description];
if ([desc hasPrefix:#"<MFMailComposeRecipientView"] == YES)
{
for (UIView* subitem in [item subviews])
{
NSString* desc2 = [subitem description];
if ([desc2 hasPrefix:#"<_MFMailRecipientTextField"] == YES)
{
UITextView* txt = (UITextView*)subitem;
}
}
}
else
if ([desc hasPrefix:#"MFComposeFromView"] == YES)
{
for (UIView* subitem in [item subviews])
{
NSString* desc2 = [subitem description];
if ([desc2 hasPrefix:#"<UITextField"] == YES)
{
UITextView* txt = (UITextView*)subitem;
}
}
}
else
if ([desc hasPrefix:#"<MFComposeSubjectView"] == YES)
{
// ...
}
else
if ([desc hasPrefix:#"<MFComposeMultiView"] == YES)
{
// ...
}
}
Change one of the four " if ([desc hasPrefix:#"..."] == YES) " content according to any needs.
You can save the [txt text] value to your own variable.

Related

how to show the annotation from table view to map view?

I have one tableview with names in each row and having different images for each title. I need to pass these titles onto mapview as a annotation contains title names as title for annotation.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = nil;
static NSString *AutoCompleteRowIdentifier = #"AutoCompleteRowIdentifier";
cell = [tableView dequeueReusableCellWithIdentifier:AutoCompleteRowIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:AutoCompleteRowIdentifier];
}
AddressInfo *addressInfo = [addressList objectAtIndex:indexPath.row];
NSString *str=[NSString stringWithFormat:#"%#",addressInfo.category];
NSString *str2=#"0";
if ([str isEqualToString:str2] ) {
UIImage *image1=[UIImage imageNamed:#"greyDot.png"];
cell.imageView.image=image1;
}
NSString *str3=#"10";
if ([str isEqualToString:str3] ) {
UIImage *image2=[UIImage imageNamed:#"blackDot.png"];
cell.imageView.image=image2;
}
NSString *str4=#"20";
if ([str isEqualToString:str4] ) {
UIImage *image3=[UIImage imageNamed:#"greendot.png"];
cell.imageView.image=image3;
}
NSString *str5=#"30";
if ([str isEqualToString:str5] ) {
UIImage *image4=[UIImage imageNamed:#"blueDot.png"];
cell.imageView.image=image4;
}
NSString *str6=#"1";
if ([str isEqualToString:str6] ) {
UIImage *image5=[UIImage imageNamed:#"0Dot.png"];
cell.imageView.image=image5;
}
cell.textLabel.text = addressInfo.name;
return cell;
}
But in my mapview I'm not getting the exact image annotation as in table view, I'm getting random images as annotation from table view, but the title name appears same as I wanted.
here is my mapview code:
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:
(id <MKAnnotation>)annotation {
pinView = nil;
if(annotation != mapview.userLocation)
{
static NSString *defaultPinID = #"defaultPinID";
pinView = (MKAnnotationView *)[mapview dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( pinView == nil ) pinView = [[[MKAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];
AddressInfo *address = [addressArray objectAtIndex:x];
NSString *dotstr=[NSString stringWithFormat:#"%#",address.category];
NSString *dotstr1=#"0";
if([dotstr isEqualToString:dotstr1])
{
NSLog(#"string 0 is %#",dotstr1);
pinView.image=[UIImage imageNamed:#"greyDot.png"];
NSLog(#"coming here 0");
}
NSString *dotstr2=#"10";
if([dotstr isEqualToString:dotstr2])
{
NSLog(#"string 10 is %#",dotstr2);
pinView.image=[UIImage imageNamed:#"blackDot.png"];
NSLog(#"coming here 10");
}
NSString *dotstr3=#"20";
if([dotstr isEqualToString:dotstr3])
{
NSLog(#"string 20 is %#",dotstr3);
pinView.image=[UIImage imageNamed:#"greendot.png"];
NSLog(#"coming here 20");
}
NSString *dotstr4=#"30";
if([dotstr isEqualToString:dotstr4])
{
NSLog(#"string 30 is %#",dotstr4);
pinView.image=[UIImage imageNamed:#"blueDot.png"];
NSLog(#"coming here 30");
}
NSString *dotstr5=#"1";
if([dotstr isEqualToString:dotstr5])
{
NSLog(#"string defau is %#",dotstr5);
pinView.image=[UIImage imageNamed:#"greyDot.png"];
NSLog(#"coming here default");
}
pinView.canShowCallout = YES;
infoButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
infoButton.tag=k;
[infoButton addTarget:self action:#selector(pinLabelClicked:) forControlEvents:UIControlEventTouchUpInside];
pinView.rightCalloutAccessoryView = infoButton;
x++;
}
else {
[mapview.userLocation setTitle:#"I am here"];
}
return pinView;
}
in first screen first rows contains blue image on left side of each row I am trying to show the same in map view but in my map view the blue annotation shows the grey image titles.
does anyone have any idea how this can be done. Any tutorials or sample code?
Check this framework https://github.com/jacobjennings/JJMapCallout.
I'm use it in one my project, and it's work great.
Also check discussions here
and here

How to set title for UIButton?

How can we set the button title for a button,i know this answer its simple,we need to set the title of the button for title ,but my need is somewhat diffrent ,i had a username which dynamically changes according to login.i set this in a button click and display it in a label within that button .my code for this is
- (void)getFacebookProfileFinished:(ASIHTTPRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
NSLog(#"Got Facebook Profile: %#", responseString);
NSString *likesString;
NSMutableDictionary *responseJSON = [responseString JSONValue];
NSString *username;
NSString *firstName = [responseJSON objectForKey:#"first_name"];
NSString *lastName = [responseJSON objectForKey:#"last_name"];
if (firstName && lastName) {
username = [NSString stringWithFormat:#"%# %#", firstName, lastName];
} else {
username = #"mysterious user";
}
[_loginButton setTitle:username forState:UIControlStateNormal];
_lblfaceusername.text = username;
[self refresh];
}
i need to display the user name in another button click and have to assing the title of that button to user name the code for this is
- (void)refresh {
if (_loginState == LoginStateStartup || _loginState == LoginStateLoggedOut) {
_loginStatusLabel.text = #"Not connected to Facebook";
[_loginButton setTitle:#"Login" forState:UIControlStateNormal];
_loginButton.hidden = NO;
} else if (_loginState == LoginStateLoggingIn) {
_loginStatusLabel.text = #"Connecting to Facebook...";
_loginButton.hidden = YES;
} else if (_loginState == LoginStateLoggedIn) {
_loginStatusLabel.text = #"Connected to Facebook";
[_loginButton setTitle:#"" forState:UIControlStateNormal];
_loginButton.hidden = NO;
}
}
i need to set the username in the [_loginButton setTitle:#"" forState:UIControlStateNormal];i want [_loginButton setTitle:username forState:UIControlStateNormal];
Anyhow you have set the button title in the method
- (void)getFacebookProfileFinished:(ASIHTTPRequest *)request
after facebook request done. Then, why you need to set that again in refresh method? Just comment out the line in LoginStateLoggedIn condition in refresh method.
//[_loginButton setTitle:#"" forState:UIControlStateNormal];
Edit
- (void)refresh {
if (_loginState == LoginStateStartup || _loginState == LoginStateLoggedOut) {
_loginStatusLabel.text = #"Not connected to Facebook";
[_loginButton setTitle:#"Login" forState:UIControlStateNormal];
_loginButton.hidden = NO;
} else if (_loginState == LoginStateLoggingIn) {
_loginStatusLabel.text = #"Connecting to Facebook...";
_loginButton.hidden = YES;
} else if (_loginState == LoginStateLoggedIn) {
_loginStatusLabel.text = #"Connected to Facebook";
NSString *username = [_loginButton titleForState:UIControlStateNormal];
[_loginButton setTitle:username forState:UIControlStateNormal];
_loginButton.hidden = NO;
}
}
What you need is storing a reference to that message at a location that both pieces of code can access. The typical way to do so is to add a NSString * _username in your interface definition, and setting it to the username when you receive it. That way you can always access it from any location that depends on the current value of it.
Memory management included, that would yield:
[_username release]; // Release possible previous login
_username = [username retain]; // Ownership needed
In refresh:
[_loginButton setTitle:_username forState:UIControlStateNormal];
In dealloc:
[_username release]; // Release ownership when not needed anymore
This allows you to access your variable at any location desired.

UISearchBar in iPhone/iPad application

I have data like this...(All the data comes from .plist file...)
Searching Array - (
{
FirstName = "Ramesh";
LastName = "Bean";
EmpCode = 1001;
},
{
FirstName = "Rohan";
LastName = "Rathor";
EmpCode = 102;
},
{
FirstName = "Priya";
LastName = "Malhotra";
EmpCode = 103;
},
{
FirstName = "Mukesh";
LastName = "Sen";
EmpCode = 104;
},
{
FirstName = "Priya";
LastName = "Datta";
EmpCode = 105;
}
)
I want implement search data from this array on the basis of FirstName (key).
I am able to search data with the "FirstName(Key)"
but after filtering data suppose i clicked Row( in the data) which is displayed in the TableView. It Navigate me to New-Controller with all the information of that particular employee (like: FirstName,LastName,EmpCode).
How can i get information?
As i gone through the search sample codes.
Here is my search code...
NSString *searchText = searchBar.text;
NSMutableArray *searchArray = [[NSMutableArray alloc] init];
NSInteger TotalNoOfRecords=[self.SearchtableDataSource count];
for (int i=0;i<TotalNoOfRecords;i++)
{ NSDictionary *dictionary = [self.SearchtableDataSource objectAtIndex:i];
NSArray *array = [dictionary objectForKey:#"FirstName"];
[searchArray addObject:array];
}
for (NSString *sTemp in searchArray)
{
NSRange titleResultsRange = [sTemp rangeOfString:searchText options:NSCaseInsensitiveSearch];
if (titleResultsRange.length > 0)
{
[copyListOfItems addObject:sTemp];
}
}
How can i improve this code?....Please guide me... [searchArray release]; searchArray = nil;
How we maintain all the "Keys(FirstName,LastName,EmpCode)" in the searchArray please help me out? Thanks...
I think the best approach would be to make an array of NSDictionary which has value for three keys namely "FirstName", "LastName", "EmpCode"
now to filter the data according to "FirstName" use NSPredicate instead of for loop,
NSString *searchText = searchBar.text;
NSPredicate* predicate = [NSPredicate predicateWithFormat:#"FirstName like[cd] %#",searchText];
NSArray* filteredArray = [self.SearchtableDataSource filteredArrayUsingPredicate:predicate];
In method cellForRowAtIndexPath
NSDictionary* currentEmp = [filteredArray objectAtIndex:inddexPath.row];
display the information in this currentEmp.
Similarly in didSelectRowAtIndexPath
NSDictionary* currentEmp = [filteredArray objectAtIndex:inddexPath.row];
and pass this dictionary in the next ViewController in which u want to dispaly the detail of the current employ.
if u have two table views one that of searchDisplayController (showing the filtered result)
and one which is showing the whole result, then u can track this by having a BOOL variable tacking that is if filtering is active or not.
Here is what i have done and its working fine with me(tested it). I have taken one IBOutlet of UISearchBar so here is the code for ur .h file
#interface SearchForEmp : UIViewController<'UISearchDisplayDelegate,UISearchBarDelegate,UITableViewDelegate,UITableViewDataSource> {
IBOutlet UISearchBar* mySearchBar;
UISearchDisplayController* mySearchDisplayController;
NSMutableArray* allEmp;
NSMutableArray* filteredEmp;
BOOL isFilatering;
}
#end
Now in .m file
-(void)viewDidLoad
{
[super viewDidLoad];
mySearchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:mySearchBar contentsController:self];
mySearchDisplayController.searchResultsDelegate = self;
mySearchDisplayController.searchResultsDataSource = self;
mySearchDisplayController.delegate = self;
isFilatering = NO;
filteredEmp = [[NSMutableArray alloc] init];
allEmp = [[NSMutableArray alloc] init];
NSDictionary *temp;
for (int i = 0; i < 30; i++) {
temp = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:#"FirstName_%d",i],#"FirstName",[NSString stringWithFormat:#"LastName_%d",i],#"LastName",[NSNumber numberWithInt:1000+i],#"EmpCode",nil];
[allEmp addObject:temp];
}
}
for e.g purpose i have thake an array of 30 Dictionaries, each with a unique name.For table view data source and delegate .....
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (isFilatering) {
return [filteredEmp count];
}
else {
return [allEmp count];
}
return [allEmp count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] init] autorelease];
}
NSDictionary* temp;
if (isFilatering) {
temp = [filteredEmp objectAtIndex:indexPath.row];
}
else {
temp = [allEmp objectAtIndex:indexPath.row];
}
cell.textLabel.text = [NSString stringWithFormat:#"%# %#",[temp objectForKey:#"FirstName"],[temp objectForKey:#"LastName"]];
return cell;
}
Now as far as searching is concerned here is what u need to do .......
-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
NSPredicate* predicate = [[NSPredicate predicateWithFormat:#"self.FirstName contains %#",mySearchBar.text] retain];
filteredEmp = [[allEmp filteredArrayUsingPredicate:predicate] retain];
}
-(void) searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller
{
isFilatering = YES;
}
-(void) searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller
{
isFilatering = NO;
}
I hope that helps you understanding the things, dont forget to add retain in line
filteredEmp = [[allEmp filteredArrayUsingPredicate:predicate] retain];
because method filteredArrayUsingPredicate: is an accessor method and its retain count is handled by the NSArray so have access to the filtered array u need to pass a retain msg to it.

resignFirstResponder

I have a little problem resigning the keyboard. I have a table with two sections. In the second section, I load the class stationenStartCellNumber which has a UITextField.
When I press anywhere outside of the UITextField, I want the keyboard to resign as first responder, and thereby closing the keyboard. It works perfectly inside of my cell, but not on my UITableView.
This is my code:
stationenViewController.h:
#import <UIKit/UIKit.h>
#import "stationenStartCell.h"
#import "stationenAppDelegate.h"
#interface stationenViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
IBOutlet UITableView *theTable;
NSString *stationenPlistPath;
}
#property (nonatomic, retain) UITableView *theTable;
#property (nonatomic, retain) IBOutlet NSString *stationenPlistPath;
- (void)copyStationPlist;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
#end
stationenViewController.m:
#import "stationenViewController.h"
#import "chooseStationView.h"
#import "chooseArrDepView.h"
#import "stationenStartCellNumber.h"
#implementation stationenViewController
#synthesize theTable;
#synthesize stationenPlistPath;
- (void)viewWillAppear:(BOOL)animated {
[theTable reloadData];
[[[self navigationController] navigationBar] setAlpha:1];
[super viewWillAppear:animated];
}
- (void)viewDidLoad
{
NSArray *bikePath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *bikeDocumentsDirectory = [bikePath objectAtIndex:0];
stationenPlistPath = [bikeDocumentsDirectory stringByAppendingPathComponent:#"stationen.plist"];
if(![[NSFileManager defaultManager] fileExistsAtPath:stationenPlistPath])
{
[self copyStationPlist];
}
[super viewDidLoad];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSUInteger returnInt = 2;
if (section == 1)
{
returnInt = 1;
}
return returnInt;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
NSString *returnString = [[NSString alloc] init];
if(section == 0)
{
returnString = #"Search station details";
}
else if (section == 1)
{
returnString = #"Search train number";
}
return returnString;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
static NSString *CellIdentifier = #"stationenStartCellID";
stationenStartCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if (cell == nil){
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:#"stationenStartCell" owner:nil options:nil];
for(id currentObject in topLevelObjects)
{
if([currentObject isKindOfClass:[stationenStartCell class]])
{
cell = (stationenStartCell *)currentObject;
break;
}
}
}
[[cell theBackground] setBackgroundColor:[[UIColor alloc] initWithPatternImage:[UIImage imageNamed:#"stationenStartCell_Background.png"]]];
[[cell theImage] setImage:[UIImage imageNamed:#"icon_checkMark.png"]];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
if(indexPath.row % 4 == 0)
{
[[cell cellName] setText:NSLocalizedString(#"Choose station", #"Main page")];
[[cell chosenValue] setText:[prefs valueForKey:#"chosenStation"]];
NSLog(#"Log info: %#", [prefs valueForKey:#"chosenStation"]);
if([[prefs valueForKey:#"chosenStation"] isEqualToString:#""] || [prefs valueForKey:#"chosenStation"] == nil)
{
[[cell theImage] setAlpha:0.2];
}
else {
[[cell theImage] setAlpha:1];
}
}
if(indexPath.row % 4 == 1)
{
NSString *searchType = [prefs valueForKey:#"searchType"];
NSString *theValue = #"";
if([searchType isEqualToString:#"0"])
{
theValue = NSLocalizedString(#"Arrivals", #"Main page");
}
else if([searchType isEqualToString:#"1"])
{
theValue = NSLocalizedString(#"Departures", #"Main page");
}
if([theValue isEqualToString:#""])
{
[[cell theImage] setAlpha:0.2];
}
else {
[[cell theImage] setAlpha:1];
}
[[cell cellName] setText:NSLocalizedString(#"Choose departure/arrival", #"Main page")];
[[cell chosenValue] setText:theValue];
}
[UIView commitAnimations];
return cell;
}
else if (indexPath.section == 1)
{
static NSString *CellIdentifier = #"stationenStartCellNumber";
stationenStartCellNumber *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:#"stationenStartCellNumber" owner:nil options:nil];
for(id currentObject in topLevelObjects)
{
if([currentObject isKindOfClass:[stationenStartCellNumber class]])
{
cell = (stationenStartCellNumber *)currentObject;
break;
}
}
}
[[cell theLabel] setText:#"Tåg nr:"];
return cell;
}
return nil;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:NO];
if (indexPath.section == 0)
{
if(indexPath.row == 0)
{
chooseStationView *chooseStationViewController = [[chooseStationView alloc] initWithNibName:#"chooseStationView" bundle:nil];
[[self navigationController] pushViewController:chooseStationViewController animated:YES];
[chooseStationViewController release], chooseStationViewController = nil;
}
else {
chooseArrDepView *chooseArrDepViewController = [[chooseArrDepView alloc] initWithNibName:#"chooseArrDepView" bundle:nil];
[[self navigationController] pushViewController:chooseArrDepViewController animated:YES];
[chooseArrDepViewController release], chooseArrDepViewController = nil;
}
}
else {
[tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[theTable becomeFirstResponder];
[super touchesBegan:touches withEvent:event];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
-(void)copyStationPlist
{
NSString* bikesDictionaryPath = [[NSBundle mainBundle] pathForResource:#"stations" ofType:#"plist"];
NSDictionary* bikesDictionary = [[NSDictionary alloc] initWithContentsOfFile:bikesDictionaryPath];
NSArray *bikePath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *bikeDocumentsDirectory = [bikePath objectAtIndex:0];
NSString *path = [bikeDocumentsDirectory stringByAppendingPathComponent:#"stations.plist"];
NSString * error;
NSData * data = [NSPropertyListSerialization dataFromPropertyList:bikesDictionary format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];
[data writeToFile:path atomically:YES];
}
- (void)dealloc {
[super dealloc];
}
#end
Offcourse, the touchesBegan code does not work on a tableView because that one takes over. How can I resign the keyboard?
you can subclass UITableView and use it instead of standard UITableView. Why? Because You will be able to do smth like this
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[super touvhesBegan:touches withRvrnt:event];
}
this method will be called each time you touch your table. so you will be able to resign your textField as firstResponder inside this method.
You can create an invisible UIButton with an action to resign the keyboard.
Also, you will want to make sure to scroll your table view so that the keyboard does not cover your text field.

segmented control in iPhone application

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
Namastey saikamesh
Please check proper u'r UISegmentControl property setting it will be working.