Search Results

Search found 2691 results on 108 pages for 'ios 4'.

Page 61/108 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • How to rotate UIViews?

    - by user717452
    The Twitter app is a tab bar app on the iPhone. Nothing in any of the tabs will rotate, yet, when you click on a link from a tweet, the view controller that is pushed on top of it IS allowed to rotate. The only rotations I have ever doe is from tilting the device, landscape or portrait, but I don't understand how to use 2d transformations and animations to rotate views. How do you rotate any view with that's a subclass of UIView?

    Read the article

  • How do I show a custom UIImagePicker within a view?

    - by cory ginsberg
    I'm making an app that involves a 'mirror.' Basically, the view should show the UIImagePickerControllerCameraDeviceFront with a custom border around it that I would create. I have looked around the web for days and I can only find a way of putting a subview on the camera view, I want it to be the opposite way. I have seen this happen before, but I have no idea as how to do it as it appears that UIImagePickerController must be a superview and can't be a subview. Please help me anyway you can and thank you in advanced.

    Read the article

  • App rejected due to "iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution"

    - by sunny
    My app got rejected by the apple because of the reason "iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution".Apple suggested that "to support the iPad 3GS 2X, and this issue is usually resolved through settings in "compatibility" mode. "no black bar's or borders"".So,my question is how to set and run the app in compatibility mode.Any one having this issue please help on this issue.I have no idea to go forward. Please any suggestions and help thanks in advance.

    Read the article

  • NSPredicate 'OR' filtering based on an NSArray of keys

    - by So Over It
    Consider the following NSArray: NSArray *dataSet = [[NSArray alloc] initWithObjects: [NSDictionary dictionaryWithObjectsAndKeys:@"abc", @"key1", @"def", @"key2", @"hij", @"key3", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"klm", @"key1", @"nop", @"key2", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"qrs", @"key2", @"tuv", @"key3", nil], [NSDictionary dictionaryWithObjectsAndKeys:@"wxy", @"key3", nil], nil]; I am able to filter this array to find dictionary objects that contain the key key1 // Filter our dataSet to only contain dictionary objects with a key of 'key1' NSString *key = @"key1"; NSPredicate *key1Predicate = [NSPredicate predicateWithFormat:@"%@ IN self.@allKeys", key]; NSArray *filteretSet1 = [dataSet filteredArrayUsingPredicate:key1Predicate]; NSLog(@"filteretSet1: %@",filteretSet1); Which appropriately returns: filteretSet1: ( { key1 = abc; key2 = def; key3 = hij; }, { key1 = klm; key2 = nop; } ) Now, I am wanting to filter the dataSet for dictionary objects containing ANY of the keys in an NSArray. For example, using the array: NSArray *keySet = [NSArray arrayWithObjects:@"key1", @"key3", nil]; I want to create a predicate that returns and array of any dictionary objects that contain either 'key1' or 'key3' (ie. in this example all dictionary objects would be returned except for the third object - as it does not contain either 'key1' or 'key3'). Any ideas on how I would achieve this? Would I have to use a compound predicate?

    Read the article

  • How to link more than one object at a time in Xcode 4.2?

    - by Beppe
    I'm probably missing the basics here... Is there a way to link more than one object to a method at a time using Interface Builder in Xcode 4.2? I set tons of UIButtons in my UIView. All of them call just one method (let's say - (IBAction)buttonPushed:(UIButton *)aButton) that should do something different depending on the sender. I can't figure out a way to link them all with my method at a time. Any advice will be very appreciated... N.B. I'm using Xcode 4.2 on Snow Leopard, without storyboard.

    Read the article

  • Redrawing content of UIWebView

    - by btate
    I have a bunch of webviews with static html content that I'm putting in a scroll view as pages. That works fine, but having 20 something full screen subviews of the scroll view is causing some lag. I solved that by only placing 5 at a time in there. The current view, and the two next and two previous. The problem now is that any web view that is not a subview of the scroll view is not drawing correctly based on the device orientation. The frame of the webview is printing out correct, but the actual content is drawing in portrait mode. So there is essentially a strip of blank space to the right of the content. How do I go about re rendering the content without reloading the page? Here's the relevant code: - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation) fromInterfaceOrientation{ [self resizeSubViews]; } - (void) setupWebViews{ if(_webViews == nil) _webViews = [[NSMutableArray alloc] init]; // This is where the navigation would come into play as far as loading up available web views [_webViews removeAllObjects]; // for loop here to create web views for (int i = 0; i < 20; i++) { //CDCWebViewController *webView = [[[MyInternalWebView alloc] initWithFrame:_webViewWrapper.frame] retain]; MyInternalWebView *page = [[[MyInternalWebView alloc] init] retain]; [page loadRequest:[NSURLRequest requestWithURL:_url]]; [page setCdcIWVdelegate:self]; [page setTestIndex:i]; [page setPageIndex:i]; [_webViews addObject:page]; [self loadScrollViewWithPage:i]; } [self clearUnusedWebViews:_pageControl.currentPage]; } - (void) setupWebViewWrapper{ // a page is the width of the scroll view _webViewWrapper.pagingEnabled = YES; _pageControl = [[[UIPageControl alloc] init] retain]; _webViewWrapper.showsHorizontalScrollIndicator = NO; _webViewWrapper.showsVerticalScrollIndicator = NO; _webViewWrapper.scrollsToTop = NO; _webViewWrapper.delegate = self; _pageControl.numberOfPages = [_webViews count]; _pageControl.currentPage = 0; } - (void) resizeSubViews{ // The frame is set in IB _webViewWrapper.contentSize = CGSizeMake(_webViewWrapper.frame.size.width * [_webViews count], _webViewWrapper.frame.size.height); // Move the content offset. _webViewWrapper.contentOffset = CGPointMake(_webViewWrapper.frame.size.width * _pageControl.currentPage, _webViewWrapper.contentOffset.y); for (MyInternalWebView *subview in _webViewWrapper.subviews) { // Reset the frame height and width here? CGRect frame = _webViewWrapper.frame; frame.origin.x = frame.size.width * subview.pageIndex; frame.origin.y = 0; [subview setFrame:frame]; } } //***************************************************** //* //* ScrollView Functions //* //***************************************************** - (void)loadScrollViewWithPage:(int)page { // Make sure we're not out of bounds if (page < 0) return; if (page >= [_webViews count]) return; MyInternalWebView *webView = [_webViews objectAtIndex:page]; // Add the preloaded webview to the scrollview if it's not there already if (nil == [webView superview]) { CGRect frame = _webViewWrapper.frame; //NSLog(@"width = %f", frame.size.width); frame.origin.x = frame.size.width * page; frame.origin.y = 0; //NSLog(@"setting frame for page %d %@", page, NSStringFromCGRect(frame)); [webView setFrame:frame]; [_webViewWrapper addSubview:[_webViews objectAtIndex:page]]; // Now that the new one is loaded, clear what doesn't need to be here [self clearUnusedWebViews:page]; } } - (void) clearUnusedWebViews: (NSInteger) page{ for (int i = 0; i < [_webViews count]; i++) { if ((page - i) <= 2 && i - page <= 2) { continue; } [[_webViews objectAtIndex:i] removeFromSuperview]; } } - (void)scrollViewDidScroll:(UIScrollView *)sender { // Switch the indicator when more than 50% of the previous/next page is visible CGFloat pageWidth = _webViewWrapper.frame.size.width; NSInteger page = floor((_webViewWrapper.contentOffset.x - pageWidth / 2) / pageWidth) + 1; _pageControl.currentPage = page; // load the visible page and the page on either side of it (to avoid flashes when the user starts scrolling) [self loadScrollViewWithPage:page - 2]; [self loadScrollViewWithPage:page - 1]; [self loadScrollViewWithPage:page]; [self loadScrollViewWithPage:page + 1]; [self loadScrollViewWithPage:page + 2]; }

    Read the article

  • Display the y value of a uiImageView during an animation

    - by user1422132
    I have the following code: NSString *yValue; yValue=[[NSString alloc] initWithFormat:@"%1.2f" , imageView.center.y]; CGRect labelFrame = CGRectMake( 10, 100, 200, 50 ); UILabel* label5 = [[UILabel alloc] initWithFrame: labelFrame]; [label5 setBackgroundColor:[UIColor blackColor]]; [label5 setText: yValue]; [label5 setTextColor: [UIColor orangeColor]]; [self.view addSubview: label5]; This correctly shows the y value of the UIimageView but the problem is that it only shows the ending y value. When a person flicks the UIImageView I animate it using: [UIView animateWithDuration:2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ recognizer.view.center = finalPoint; } What I want is the label5 to display the y value of the imageView during the animation not just after. Is it possible to do this?

    Read the article

  • Creating UIButtons

    - by Ralphonzo
    During loadView I am creating 20 UIButtons that I would like to change the title text of depending on the state of a UIPageControl. I have a pre-save plist that is loaded into a NSArray called arrChars on the event of the current page changing, I set the buttons titles to their relevant text title from the array. The code that does this is: for (int i = 1; i < (ButtonsPerPage + 1); i++) { UIButton *uButton = (UIButton *)[self.view viewWithTag:i]; if(iPage == 1) { iArrPos = (i - 1); } else { iArrPos = (iPage * ButtonsPerPage) + (i - 1); } [uButton setAlpha:0]; NSLog(@"Trying: %d of %d", iArrPos, [self.arrChars count]); if (iArrPos >= [self.arrChars count]) { [uButton setTitle: @"" forState: UIControlStateNormal]; } else { NSString *value = [[NSString alloc] initWithFormat:@"%@", [self.arrChars objectAtIndex:iArrPos]]; NSLog(@"%@", value); [uButton setTitle: [[NSString stringWithFormat:@"%@", value] forState: UIControlStateNormal]; [value release]; //////Have tried: //////[uButton setTitle: value forState: UIControlStateNormal]; //////Have also tried: //////[uButton setTitle: [self.arrChars objectAtIndex:iArrPos] forState: UIControlStateNormal]; //////Have also also tried: //////[uButton setTitle: [[self.arrChars objectAtIndex:iArrPos] autorelease] forState: UIControlStateNormal]; } [uButton setAlpha:1]; } When setting the Title of a button it does not appear to be autoreleasing the previous title and the allocation goes up and up. What am I doing wrong? I have been told before that tracking things by allocations is a bad way to chase leaks because as far as I can see, the object is not leaking in Instruments but my total living allocations continue to climb until I get a memory warning. If there is a better way to track there I would love to know.

    Read the article

  • Method invoked but not returning anything

    - by or azran
    i am calling this method from a touch in UITableViewCell , -(void)PassTitleandiMageByindex:(NSString *)number{ NSLog(@"index : %d",number.intValue); NSArray *objectsinDictionary = [[[NSArray alloc]init]autorelease]; objectsinDictionary = [[DataManeger sharedInstance].sortedArray objectAtIndex:number.intValue]; if ([objectsinDictionary count] > 3) { ProductLabel = [objectsinDictionary objectAtIndex:3]; globaliMageRef = [objectsinDictionary objectAtIndex:2]; [self performSegueWithIdentifier:@"infoseg" sender:self]; }else{ mQid = [objectsinDictionary objectAtIndex:1]; globaliMageRef = [objectsinDictionary objectAtIndex:2]; [mIQEngines Result:mQid]; NSLog(@"mQid : %@ Global : %@",mQid,globaliMageRef); }} Problem:- i am trying to get the same functionality programmatically by calling [self PassTitleandiMageByindex:stringNumber]; when i am calling this programmatically i can see the debug log getting in the place it should be, but nothing happens (by pressing the UITableViewCellon the screen) here is how it turns on by touch, - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *st = [NSString stringWithFormat:@"%d",[indexPath row]]; [self PassTitleandiMageByindex:st];} I have also tried to call the table-view delegate by :[[Tview delegate] tableView:Tview didSelectRowAtIndexPath:selectedCellIndexPath]; but, nothing happened.

    Read the article

  • How to remove statusbar from messageviewcontroller?

    - by hckr
    I am sending sms programmatically from my view controller but now it is showing me statusbar and vertical black line my code: - (IBAction)SendTextBtnTapped:(id)sender { [self sendSMS:@"Body of SMS..." recipientList:[NSArray arrayWithObjects: nil]]; } - (void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSArray *)recipients { MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init]; if([MFMessageComposeViewController canSendText]) { controller.body = bodyOfMessage; controller.recipients = recipients; controller.messageComposeDelegate = self; [self presentModalViewController:controller animated:YES]; } } - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result { [self dismissModalViewControllerAnimated:YES]; if (result == MessageComposeResultCancelled) NSLog(@"Message cancelled"); else if (result == MessageComposeResultSent) NSLog(@"Message sent"); else NSLog(@"Message failed"); } and my screen look like this:

    Read the article

  • Affine Transforms with Demo App

    - by Dex
    I have a demo app here https://github.com/rdetert/image-transform-test After importing an image, you can pinch, zoom, rotate the image. What I want to do is save out a 640x480 image (landscape mode) that looks identical to the live preview. So if there are 100px bars of empty space on the sides, I need the same empty bars in the final output (scaled appropriately). This is proving to be more difficult than I thought it would be. I can't quite get it to come out right after days of working on it. The magic method that generates the final image is called -(void)generateFinalImage Good luck! ;)

    Read the article

  • data parameter is nil error when checking internet connectivity

    - by JSA986
    When launching my app it checks if user is subscribed. If it dosent detect an internet connection it crashes with the error: Failed to retrieve subscription with error 'The Internet connection appears to be offline.' and responseString: (null)*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil' .m [self getPath:path parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { if (![responseObject isKindOfClass:[NSDictionary class]]) { failureBlock(@"Invalid response received"); return; } NSDictionary *subscriptionDict = (NSDictionary *)responseObject; if (subscriptionDict[@"error"] == nil) { DebugLog(@"Successfully retrieved subscription"); successBlock(subscriptionDict); } else { failureBlock(responseObject); } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { DebugLog(@"Failed to retrieve subscription with error '%@' and responseString: %@", error.localizedDescription, operation.responseString); id responseObject = [NSJSONSerialization JSONObjectWithData:operation.responseData options:0 error:nil]; failureBlock(responseObject); }]; }

    Read the article

  • How to speed up saving a UIImagePickerController image from the camera to the filesystem via UIImagePNGRepresentation()?

    - by kazuhito0000
    I'm making an applications that let users take a photo and show them both in thumbnail and photo viewer. I have NSManagedObject class called photo and photo has a method that takes UIImage and converts it to PNG using UIImagePNGRepresentation() and saves it to filesystem. After this operation, resize the image to thumbnail size and save it. The problem here is UIImagePNGRepresentation() and conversion of image size seems to be really slow and I don't know if this is a right way to do it. Tell me if anyone know the best way to accomplish what I want to do. Thank you in advance.

    Read the article

  • how do i let text fit to UIButton?

    - by iAsk
    problem: Button size is enough, however when I change title, the title text cannot fit the button width. Any SDK function can solve this problem, or I need to manually code to solve it? Please refer to following pictures. design in the nib file. initial show in simulator when I change the title text tried some ways before _button.titleLabel.adjustsFontSizeToFitWidth = YES; the way will change my font size. I cannot accept the way. [_button setTitleEdgeInsets:UIEdgeInsetsMake(10.0, 10.0, 0.0,0.0)]; the way change label's position only, not label size. [_button.titleLabel sizeToFit]; result is same with picture(3). [_button sizeToFit]; title moved to upper left corner, and the title still the same result. Just confused, my button size is big enough, why title size is so small?

    Read the article

  • Load view when button is clicked in Xcodes Storyboard

    - by dooonot
    I just started to use Storyboard in Xcode. I have a starting view that has some buttons inside. Is there a way to load a special view when a button is clicked? I only found this workaround: -(IBAction)loadRegistration:(id)sender { // load registration controller UIStoryboard *storyboard = self.storyboard; RegisterController *svc = [storyboard instantiateViewControllerWithIdentifier:@"RegisterController"]; [self presentViewController:svc animated:YES completion:nil]; }

    Read the article

  • Navigating to rootViewController of non-visible UINavigationController CRASH

    - by Bertie
    First off I'n not sure if this is exactly the issue... but it appears to be central to the problem. There are vast gaps in what I know and this may be something very obvious. I have a split view controller with various Master and Detail Views. From one 'menu' branch I want to return to the rootView of both the Master & Detail Navigation Controllers when the user taps a 'Done' button. Initially I had the button positioned on the navigation bar of the master view. This is the code I was using: - (IBAction)doneClicked:(id)sender { UINavigationController *detailNav = [self.splitViewController.viewControllers objectAtIndex:1]; NSArray *allDetailViewControllers = detailNav.viewControllers; HomePage *destinationDetailVC = [allDetailViewControllers objectAtIndex:0]; destinationDetailVC.splitViewBarButtonItem = self.splitViewButton; [detailNav popToRootViewControllerAnimated:NO]; [self.navigationController popToRootViewControllerAnimated:NO]; } That works fine but if the device is in portrait mode it means the user has to open the menus to access the button. So I decided to put the 'Done' button onto the detail view NavBar instead. Using a delegate declared in the detailVC and adopted by the masterVC I am now using this method: - (void)theUserClickedDoneInTheDetailView:(DetailVC *)controller withButton:(UIBarButtonItem *)splitViewButton { UINavigationController *detailNav = [self.splitViewController.viewControllers objectAtIndex:1]; NSArray *allDetailViewControllers = detailNav.viewControllers; HomePage *destinationDetailVC = [allDetailViewControllers objectAtIndex:0]; destinationDetailVC.splitViewBarButtonItem = splitViewButton; [detailNav popToRootViewControllerAnimated: NO]; [self.navigationController popToRootViewControllerAnimated:NO]; } Both methods are in the MasterVC.m file The only difference between the two is that on is passed a UIBarButtonItem to use and the other has already had it passed when it is set in the detail view. That seems to be working because I do get a button. When the device is in Landscape mode both methods work fine. All behaviour as expected. When the device is in Portrait the first method still works fine. The second appears to work fine and the detail view is the rootView, the button for the menus is there BUT, as soon as I turn the device to landscape it crashes. The only thing I can think of is that it is because the masterView is hidden. Can anyone help...?

    Read the article

  • Push a detail view in UITableViewCell class

    - by luca
    My class inherit from UITableViewCell, i have make some custom transitions to push a new detail view when an image get selected. [UIView transitionWithView:self.masterView duration:0.5 options:UIViewAnimationOptionShowHideTransitionViews animations:^ { [self.masterView addSubview:self.detailImage]; } completion:nil]; My code works fine, the detailImage subview is shown with a transition, but this transition is not what i want exactly. What i want to perform is a simple transition from bottom to up. The list of UIViewAnimation doesn't contain such animation. Is there any way to use that transition without changing my class inheritance to UINavigationController ?

    Read the article

  • how to slove error when using thread?

    - by ChandreshKanetiya
    I have following error msg in console when using NSThread "Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now..." I have submit my sample code here - (void)viewDidLoad { appDeleg = (NewAshley_MedisonAppDelegate *)[[UIApplication sharedApplication] delegate]; [[self tblView1] setRowHeight:80.0]; [super viewDidLoad]; self.title = @"Under Ground"; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [NSThread detachNewThreadSelector:@selector(CallParser) toTarget:self withObject:nil]; } -(void)CallParser { Parsing *parsing = [[Parsing alloc] init]; [parsing DownloadAndParseUnderground]; [parsing release]; [self Update_View]; //[myIndicator stopAnimating]; [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; } here "DownloadAndParseUnderground" is the method of downloding data from the rss feed and -(void) Update_View{ [self.tblView1 reloadData]; } when Update_View method is called the tableView reload Data and in the cellForRowAtIndexPath create error and not display custom cell - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; CustomTableviewCell *cell = (CustomTableviewCell *) [tblView1 dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"customCell" owner:self options:nil]; cell = objCustCell; objCustCell = nil; }

    Read the article

  • Adding UIView on top of all views dynamically during runtime?

    - by Easwaramoorthy Kanagaraj
    Team, I am trying to bring a menu in top of all visible views during runtime. This menu should be easily addable and removable dynamically in certain conditions. To do this, I have tried adding a button view to the UIWindow as a subview during runtime. UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:nil forControlEvents:UIControlEventTouchDown]; [button setTitle:@"Show View" forState:UIControlStateNormal]; button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); [window addSubview:button]; [window makeKeyAndVisible]; [window bringSubviewToFront:button]; But it doesnt worked. Also I have tried to place this button in the root view controller, but no luck again. Edit - Note: This code is not from a UIViewController. I am trying to build a library this will be in that library code. Use case be like you could post NSNotification to enable and disable this menu dynamically during runtime. Please suggest. Thanks !

    Read the article

  • Check if NSString exists in custom object in NSArray

    - by Paul Peelen
    I have an NSArray with Store objects. Each Store object has two NSString objects; StoreID and Name. I would like to check quickly if an ID exists in this NSArray with Store objects. Example: Store *s1 = [[Store alloc] init]; s1.name = @"Some Name"; s1.id = @"123ABC"; Store *s2 = [[Store alloc] init]; s2.name = @"Some Other Name"; s2.id = @"ABC123"; NSArray *array = [[NSArray alloc] initWithObjects:s1, s2, nil]; NSString *myIdOne = @"ABCDEF"; NSString *myIdTwo = @"123ABC"; BOOL myIdOneExists = ...? BOOL myIdTwoExists = ...? Its the ...? I need to figure out. I know I can do this using a for loop and break when found... but this seems to me like an nasty approach since the NSArray could contain thousands of objects,... theoretically. So I would like to know about a better solution.

    Read the article

  • Showing a MKAnnotation for custom object

    - by Chamanhm
    I have a list of objects and each of those has a title, name, description, latitude, longitude and address. Is it possible to show this objects as MKAnnotations? I've been stuck with this for hours now. When I tried to make the objects have a CLLocationCoordinate2D I kept getting the error about latitude or longitude not being assignable. #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface Oficina : NSObject <MKMapViewDelegate> @property (nonatomic, readwrite) CLLocationCoordinate2D oficinaCoordinate; @property (nonatomic, strong) NSString *oficinaCiudad; @property (nonatomic, strong) NSString *oficinaEstado; @property (nonatomic, strong) NSString *oficinaTitulo; @property (nonatomic, strong) NSString *oficinaTelefono; @property (nonatomic, strong) NSString *oficinaLatitud; @property (nonatomic, strong) NSString *oficinaLongitud; @property (nonatomic, strong) NSString *oficinaID; @property (nonatomic, strong) NSString *oficinaDireccion; @property (nonatomic, strong) NSString *oficinaHorario; @property (nonatomic, strong) NSString *oficinaTipoDeOficina; @property (nonatomic, strong) NSString *oficinaServicios; @property (nonatomic, strong) NSString *oficinaTipoDeModulo; @end So after consuming an internet service I get around 70 of these objects. Now I want to be able to turn each of those into a map annotation. This is one of the ways I've tried to assign the latitude but I get the error "Expression not assignable".. currentOffice.oficinaCoordinate.latitude = [parseCharacters floatValue]; Where currentOffice is an instance of my custom object.

    Read the article

  • Settings cell selected background view removes backgroundview

    - by Chris
    I'm trying to set up custom UITableViewCells. I can set the backgroundView no problem, but if I set selectedBackgroundView, the cell's background becomes white and only the selected background is seen: - (void) createCell: (UITableViewCell*)cell onRow: (NSUInteger)row { UIImageView* bgImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_background_red.png"]]; cell.backgroundView = bgImage; cell.selectedBackgroundView = bgImage; cell.textLabel.hidden = YES; UILabel* titleLabel = [[UILabel alloc] initWithFrame: CGRectMake(20, CGRectGetHeight(cell.frame) / 2, 200, 50)]; titleLabel.text = [[self.ruleList objectAtIndex: row] objectForKey: TitleKey]; titleLabel.backgroundColor = [UIColor clearColor]; [cell.contentView addSubview: titleLabel]; }

    Read the article

  • Odd Segue Behaviour - Not Firing

    - by Zak
    So I've noticed some very weird behaviour from my program. Here's a simplified code snippet and then I'll explain what occurs when built and ran. -(void)viewDidLoad { [super viewDidLoad]; ... if (self.sampleBool) { [self performSegueWithIdentifier:@"mySegue" sender:self]; } else { // do stuff } } ... -(IBAction)myMethod:(UITapGestureRecognizer*)sender { ... [self performSegueWithIdentifier:@"mySegue" sender:self]; } The segue triggers via the UITapGestureRecognizer fine - so I know the segue is linked correctly. However, when self.sampleBool is true and performSegueWithIdentifier is called within viewDidLoad, the segue does not fire. Anyone have any guesses? Any help or advice is appreciated. Thanks

    Read the article

  • Changing UIViews during UIInterfaceOrientation on iPad

    - by FreeAppl3
    I am trying to change views on rotation because my views have to be significantly different from portrait to landscape. Now the code I am using works once then the app freezes when trying to rotate back. Either direction does not make a difference. For example: If I am in Landscape and rotate to portrait everything works great until I rotate back to landscape then it freezes and does absolutely nothing. Here is the code I am using to achieve this In my "viewDidLoad" method [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; Then I call this for the rotation: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } - (void)didRotate:(NSNotification *)notification { UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; if ((orientation == UIDeviceOrientationLandscapeLeft) || (orientation == UIDeviceOrientationLandscapeLeft)) { // present the other viewController, it's only viewable in landscape [self.view addSubview:landScapeView]; } if ((orientation == UIDeviceOrientationLandscapeRight) || (orientation == UIDeviceOrientationLandscapeRight)) { // present the other viewController, it's only viewable in landscape [self.view addSubview:landScapeView]; } else if ((orientation == UIDeviceOrientationPortrait || (orientation == UIDeviceOrientationPortrait)) { // get rid of the landscape controller [self.view addSubview:portrait]; } else if ((orientation == UIDeviceOrientationPortraitUpsideDown || (orientation == UIDeviceOrientationPortraitUpsideDown)) { // get rid of the landscape controller [self.view addSubview:portrait]; } }

    Read the article

  • Getting a SIGABRT error in dismissModalViewController

    - by mcalleja
    Im receiving a SIGABRT error when I cancel a MFMailComposeViewController, exactly in the dismissViewController, don't work I have a UIViewController within a UINavigationController. My Code: - (void)sendMail { if ([MFMailComposeViewController canSendMail]) { controller = [[MFMailComposeViewController alloc] init]; [[controller navigationBar] setTintColor:[UIColor getHexColorWithRGB:@"e2de09" alpha:1.0f]]; controller.mailComposeDelegate = self; [controller setSubject:@"Subject"]; NSString *msg="xxxxx"; [controller setMessageBody:msg isHTML:YES]; [self presentModalViewController:controller animated:YES]; } else { NSString * errorString = [NSString stringWithFormat:@"mail account not set."]; UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error:" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [errorAlert show]; } } The presentModalViewController:animated: works correctly. - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [self becomeFirstResponder]; [self dismissModalViewControllerAnimated:YES]; } But calling [self dissmissModalViewControllerAnimatedLYES] causes a SIGABRT error.

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >