Search Results

Search found 8 results on 1 pages for 'user337174'.

Page 1/1 | 1 

  • Creating Actions from UIActionSheets help

    - by user337174
    I am using two UIAction sheets within my current project. I can get one to work perfectly fine but when i insert a second action sheet it runs the same arguements as the first. How do i define the actionsheets seperatly? -(IBAction) phoneButtonClicked:(id)sender { // open a dialog with just an OK button UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil]; actionSheet.actionSheetStyle = UIActionSheetStyleDefault; [actionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table) [actionSheet release]; } -(IBAction) mapButtonClicked:(id)sender { // open a dialog with just an OK button UIActionSheet *mapActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[NSString stringWithFormat:@"Map"],nil]; mapActionSheet.actionSheetStyle = UIActionSheetStyleDefault; [mapActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table) [mapActionSheet release]; } -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0){ NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone]; NSLog(@"Calling: %@", callPhone); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]]; } }

    Read the article

  • UIActionSheet Cancel button keeps crashing my app

    - by user337174
    I am really puzzeled by this one. I have set up two UIActionSheets in my application. They work perfectly fine until you use the cancel button in the UIActionSheets. When i navigate away from the page the UIAactionSheet returns too it crashes my app. Does anyone have any ideas as too why? -(IBAction) phoneButtonClicked:(id)sender { // open a dialog with just an OK button phoneActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil]; phoneActionSheet.actionSheetStyle = UIActionSheetStyleDefault; [phoneActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table) [phoneActionSheet release]; } -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (actionSheet == phoneActionSheet) { if(buttonIndex == 0){ NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone]; NSLog(@"Calling: %@", callPhone); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]]; } } }

    Read the article

  • Inserting a line break from a variable objective c

    - by user337174
    I am pulling data into my iphone application using xml. The xml value is then placed in a variable. example variable: 123 London road \n London \n England The variable is then set as a label. I want the line breaks to appear in the label, instead it is printing \n. If i manually set the label value locationLabel.text = @"123 London road \n London \n England" It works as i want it to. Can anyone explain this?

    Read the article

  • How i can i use the value of a variable from one class in another in objective c?

    - by user337174
    Hi i am fairly new to objective c and have been doing some iphone programming. Is it possible to look up the value of a variable in a different class? Basically what i am doing is running a function that exists in my app delegate from a view controller, but the app delegate needs to use a variable stored in the view controller from which the app delegate function was called. Make sense??? Any help would be grateful. James

    Read the article

  • Is there a way to fix the background image of a UITableView

    - by user337174
    Hi I have set the background of my UITable with a custom image. self.tableView.backgroundColor = [UIColor clearColor]; self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]; The problem im having is the background image is scrolling and doesn't look good at the top and bottom of the screen where you see the image being joined. Is there a way to fix the position of the background image and just have the table scroll over the top of it?

    Read the article

  • Text being printed twice in uitableview

    - by user337174
    I have created a uitableview that calculates the distance of a location in the table. I used this code in cell for row at index path. NSString *lat1 = [object valueForKey:@"Lat"]; NSLog(@"Current Spot Latitude:%@",lat1); float lat2 = [lat1 floatValue]; NSLog(@"Current Spot Latitude Float:%g", lat2); NSString *long1 = [object valueForKey:@"Lon"]; NSLog(@"Current Spot Longitude:%@",long1); float long2 = [long1 floatValue]; NSLog(@"Current Spot Longitude Float:%g", long2); //Getting current location from NSDictionary CoreDataTestAppDelegate *appDelegate = (CoreDataTestAppDelegate *) [[UIApplication sharedApplication] delegate]; NSString *locLat = [NSString stringWithFormat:appDelegate.latitude]; float locLat2 = [locLat floatValue]; NSLog(@"Lat: %g",locLat2); NSString *locLong = [NSString stringWithFormat:appDelegate.longitude]; float locLong2 = [locLong floatValue]; NSLog(@"Long: %g",locLong2); //Location of selected spot CLLocation *loc1 = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2]; //Current Location CLLocation *loc2 = [[CLLocation alloc] initWithLatitude:locLat2 longitude:locLong2]; double distance = [loc1 getDistanceFrom: loc2] / 1600; NSMutableString* converted = [NSMutableString stringWithFormat:@"%.1f", distance]; [converted appendString: @" m"]; It works fine apart from a problem i have just discovered where the distance text is duplicated over the top of the detailed text label when you scroll beyond the height of the page. here's a screen shot of what i mean. Any ideas why its doing this?

    Read the article

1