Search Results

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

Page 39/108 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • How to use AutoLayout to position UIButtons in horizontal lines?

    - by thomers
    I need to create a couple of UIButtons programmatically in my app (iOS 6.0 and above). Each button should have the optimal width to display button label text (of various lenghts). I want to display the buttons in a "wrap around" style: Starting from the left edge, each button should be positioned next to each other horizontally (in a defined order), and if a button does not fit in the current "line", it should start a new line on the left edge below the previous line. I could manually calculate the frame of each button in my code, but should I use AutoLayout (with programmatically creates NSLayoutConstraints) instead? How exactly would I need to set it up?

    Read the article

  • Save and Load Data on Today Extensions (iOS 8)

    - by Massimo Piazza
    Is it possible to save and load data on Today Extension using NSUserDefaults? After closing the Notification Center, the widget behaves like an app which is terminated, so any data results lost. How could I solve this issue? This is my code: NSUserDefaults *defaults; - (void)viewDidLoad { [super viewDidLoad]; defaults = [NSUserDefaults standardUserDefaults]; NSArray *loadStrings = [defaults stringArrayForKey:@"savedStrings"]; if ([loadStrings objectAtIndex:0] != nil) { [display setText:[NSString stringWithFormat:@"%@", [loadStrings objectAtIndex:0]]]; } if ([loadStrings objectAtIndex:1] != nil) { calculatorMemory = [NSString stringWithFormat:@"%@", [loadStrings objectAtIndex:1]].doubleValue; } } - (IBAction)saveData:(id)sender { NSString *displayString; NSString *memoryString; NSArray *saveStrings = [[NSArray alloc] initWithObjects: displayString, memoryString, nil]; defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:saveStrings forKey:@"savedStrings"]; [defaults synchronize]; }

    Read the article

  • How to submit an app that uses an iOS6 feature?

    - by Darren
    I'm ready to submit my app to apple, however it says on the iOS Dev portal that xCode 4.5 cannot be used to submit apps yet, use the public release. xCode 4.4 wont compile my project because I am using -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } which is the new way to support orientation changes. It seems strange with iOS6 round the corner that I cannot submit this. Must I remove this and submit, then resubmit to support iOS6 when they allow it, or has anyone successfully submitted from xCode 4.5 beta 4? Thanks

    Read the article

  • fastest in objC: IsEqualToString:@"" or length > 0?

    - by Cœur
    I'd like to know which one is fastest for testing a non-empty NSString for iOS 4.0+ (iPhone 3G). Note: the strings to test will be 99% of the time from 2 to 100 chars length. if ([foo length] > 0) or if ([foo isEqualToString:@""] == NO && foo != nil) I think it depends if isEqualToString: compares the length first (and in that case first way is faster) or if isEqualToString: compares first character of strings first (and in that case second way might be faster). ps: I already know isEqualToString: is faster than isEqual: which is itself faster than compare:.

    Read the article

  • Looking for a mobile platform to view vector data and use it like a simple map

    - by Orchestrator
    I would like to develop or use an existing platform that will allow me to view custom vector data and use it as a map on mobile phones such as Android/IPhone (Maybe even WP7). I'm hoping that there's already a good infrastructure for what I need so I would not need to develop a whole infrastructure by myself. In Conclusion - Is there any existing platform that may answer my needs? If not, how would you guys suggest I should begin? How should I save my vector data? How could I read it? Should I view it with a graphics engine like OpenGL? Is there any chance this solution could be cross-platform? I know that it's possible since it was already done with apps like Waze. And it works the same on iOS and Android. Thanks!

    Read the article

  • NSInvalidArgumentException when updating WebView from AppDelegate

    - by H.Protagonist
    I had to do an update in my WebView from the Appdelegate.m I try it like this: [self performSelectorOnMainThread:@selector(loadWebViewWithContent:) withObject:requestObj waitUntilDone:NO]; The loadWebViewWithContent Method works great from ViewController.m, but not from the Appdelegate. I allready wrote this in my Appdelegate.h: -(void)loadWebViewWithContent:(NSURLRequest *)requestObj; Whats wrong? Please help me. I´m still a big Noob in IOS. Error: -[AppDelegate loadWebViewWithContent]: unrecognized selector sent to instance 0x1f86a5e0*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate loadWebViewWithContent]: unrecognized selector sent to instance 0x1f86a5e0'

    Read the article

  • jQuery Mobile tap bug : same target twice

    - by hugo
    I'm working on displaying some text in an UIWebView on iOS. I'd like to get the content of the HTML element tapped by the user. If he taps on a paragraph for example, a popup shows the paragraph content. I'm using jQuery Mobile to achieve this. Here's what I'm doing : $('body').tap(function(e) { var tappedElement = $(e.target); alert(tappedElement.text()); }); It works for the first tap. The second tap no matter where it is, returns the same text. The event seems to be ok but the target property of the second tap is wrong. On the third tap all comes back to normal and so on ... What am I missing here ? thx

    Read the article

  • Don't know how to encrypt database using SQLCipher

    - by Armaan
    I have included SQLCipher into my project exactly like explained in this link: http://sqlcipher.net/ios-tutorial/ But I am not sure how to encrypt the database I have read description from above link but not getting. Actually what I am doing is if application is opening first time then it will copy the database(i.e. without encryption) to the document directory. One more thing my database is blank when copying from bundle to document directory. I have tried to use sqlite3_key function after opening the database but nothing is encrypted. But I didn't found something like how to encrypt database when copying from bundle to document directory. I am planning to use FMDB so it would be better to reply according to that. Please guide me how to do that or point to direction if is there any tutorial for it. Also suggest what should be the standard approach to do that.

    Read the article

  • iOS 6 "jailbreaké" moins d'une journée après son lancement par le groupe de hackers Dev-Team, l'iPhone 5 bientôt déverrouillé ?

    iOS 6 "jailbreaké" moins d'une journée après son lancement Par le groupe de hackers Dev-Team, l'iPhone 5 bientôt déverrouillé ? L'iPhone Dev-Team, un groupe de hackers indépendant spécialisé dans les produits Apple, a réussi à créer un Jailbreak (déverrouillage) pour l'iOS 6. Cette annonce est survenue moins d'une journée après la sortie de ce dernier. [IMG]http://idelways.developpez.com/news/images/jailbreak.jpg[/IMG] Sorti dans la lignée du célèbre outil redsn0w, le jailbreak fonctionne seulement pour l'iPhone 4, l'iPhone 3GS et la quatrième génération de l'iPod Touch, soit uniquement des dispositifs équipés de processeurs A4. L'iPhone 5 n'est ...

    Read the article

  • How to tell an iphone app user what will happen before opening Facebook login dialogue

    - by docno
    Apps that allow users to log in over a 3rd party authentication provider (e.g. Facebook, Google, Twoitter,...) should open a browser window to let the user authenticate against the provider. That means, at some point, an app is backgrounded and the user interacts with a browser window. Just before the browser opens, it's a recommended pratctice to inform the user about what will happen (see e.g. Getting Started with OAuth 2.0 - O'Reilly), let's say an alert window with something like "you will leave now the XYZ app and a browser window will open where you can enter your credentials safely". My question: How can that be done if I use the facebook SDK for ios? Looking at the SDK, there seem to be no notifications and no designated states that would allow me to detect that the sdk is about to background my app and about to opening either Safari or the Facebook app.

    Read the article

  • iPad: How can I implement a scrolling timeline using a static image?

    - by BeachRunnerJoe
    I'm diving into iOS development and I'm building a simple timeline app using a static timeline image that I already have. The timeline image won't fit on the screen. The width of the image is about five times the width of the iPad screen, so I have to allow the user to scroll the image horizontally. Here's a mockup... For each item on the timeline, the user can tap it to receive a description at the bottom of the screen. My questions are... I was planning to use a UIScrollView with a PageControl at the bottom. Can a UIScrollView hold a single view that holds the entire timeline image or do I have to break the the timeline image up into multiple views? Are there any performance issues I need to consider when implementing this with a UIScrolLView, using a static image? Are there other approaches to implementing this scrollable timeline that I should consider other than using a UIScrollView? Thanks so much in advance for your wisdom!

    Read the article

  • Google Drive pour mobiles permet d'éditer les feuilles de calcul et de les créer directement depuis l'application iOS et Android

    Google Drive : une version pour iOS s'attaque à iCloud Un nouveau SDK et un mode hors-ligne pour Chrome sont disponibles Tout comme Chrome (disponible pour iOS) et tout comme les Google Maps (accessibles hors-ligne sur Android), Google Drive ? le service de stockage qui chapeaute à présent Google Docs ? est disponible offline et sur les terminaux mobiles d'Apple. Hors-ligne. Ce qui signifie que l'utilisateur peut « créer et éditer des documents ou laisser un commentaire. Tous les changements seront automatiquement synchronisés dès que vous vous ...

    Read the article

  • Converting iPhone/iPad apps onto Android

    - by jimbo
    Hi all, I have started to build my own apps on iPhones and iPad using the iPhone SDK, and the next question that is aways asked by the client is "Can we have it on Android?"... So my question to you the 'internet' is, what are my options? I don't have the time to learn another language, (learning iOS has been enough!) so are there companies who specialize in this, or are there online option that do a convert? Any help on this welcome, just need to know which way to turn...

    Read the article

  • how do I get the SDK version for an app running on the simulator programmatically?

    - by newbiez
    I am trying to get the version/build that is running on the simulator via code. Basically I am checking various features of my app using the simulator, and want to switch code paths on and off based on which SDK do I have set as current, instead than doing it by hand every time (my testing machine has different version of the SDK on it and I switch the current for testing purposes between 4.1 and 5.1). So the idea is that when the app launch on the simulator, I can read the build of the SDK and know trough matching (I have a function that does the matching and turn on and off the features) if I should run a specific code path or not. I know how to figure out if I am running on the sim or on a device, but cannot find references about how to get the version of the SDK via code, so I am basically stuck. Is there any function that I can call and that returns me the build or version of the currently installed iOS, while I am running the app on the simulator?

    Read the article

  • Function 'didFinishLaunchingWithOptions' getting invoked inappropriately

    - by clint
    I connected my IOS device to a MAC processor and installed/initialized my app running in xcode or dragged it from itunes folder. Now i physically disconnected my device from the processor and through wifi enabled in the device, sent notifications/messages through APNS to the device. I was able to successfully receive notifications in the device. Now after some time, i reconnected the device to the processor, which lead to a problem of the app launching again and calling 'didFinishLaunchingWithOptions' method again, which is not desirable as the launch/initialization should happen only once. This behaviour is random ie. every time when i disconnect/reconnect, it is not happening, only sometimes. Why is this happening. What could be the reason for this random behaviour. Any help will be appreciated.Thanks

    Read the article

  • iOS 7 sur iPad : les premières vraies images, nouvelle interface et nouvelles fonctionnalités arrivent avec la beta 2 du système

    iOS 7 sur iPad : les premières vraies images Nouvelle interface et nouvelles fonctionnalités arrivent avec la beta 2 du systèmeLes spéculations sur ce que sera iOS 7 pour iPad continuent. Sauf que depuis ce lundi, Apple a effectivement sorti une pré-version du système (la beta 2) compatible avec les tablettes de la marque.Malgré une clause de confidentialité censée empêcher les développeurs qui la testent d'en parler, de nombreuses captures d'écrans et des vidéos ? cette fois-ci réelles ? sont apparues dans la journée.Pas d'immense nouveauté côté fonctionnalités à noter par rapport à la version pour iPhone/iPad (Photobooth, retour des mémos voix, nouvelle manière de passer d'une application ouver...

    Read the article

  • Google Drive : nouvelles applications iOS et Android, les solutions mobiles de stockage et de partage en ligne sont de plus en plus complètes

    Google Drive : une version pour iOS s'attaque à iCloud Un nouveau SDK et un mode hors-ligne pour Chrome sont disponibles Tout comme Chrome (disponible pour iOS) et tout comme les Google Maps (accessibles hors-ligne sur Android), Google Drive ? le service de stockage qui chapeaute à présent Google Docs ? est disponible offline et sur les terminaux mobiles d'Apple. Hors-ligne. Ce qui signifie que l'utilisateur peut « créer et éditer des documents ou laisser un commentaire. Tous les changements seront automatiquement synchronisés dès que vous vous ...

    Read the article

  • What is this type of programming called (creating an online network)?

    - by Byron S
    For practice purposes, I am looking to build an application that is capable of connecting multiple devices through the internet. It will be similar to craigslist, but I want to make this as an iOS application. I have very little experience with web services, as the most I've done is pulled an RSS feed onto the screen. How are these things normally done? If it's similar to a message board, is it as simple as having a database in a server/cloud, and giving all users access to it? Or is it more complicated than that? How should I begin to learn more about the backend? What kind of services are usually used in this kind of thing? The only database I've used is Core Data.

    Read the article

  • Error when changing or resetting FBProfilePictureView profileId

    - by Jeff Schwartz
    I have programmatically added an FBProfilePictureView object to a view. When initially logging in, the user's profile picture displays as expected when setting the profileId of the object within the FBLoginViewDelegate method loginViewFetchedUserInfo:user:. However, when logging off the following line of code produces an error: profilePicture.profileId = nil; The error thrown is: [__NSCFNumber isEqualToString:]: unrecognized selector sent to instance Note: This was only an issue after I incrementally upgraded the iOS SDK from 3.5 to 3.8. If anyone has encountered this issue, please let me know. Thanks!

    Read the article

  • iOS Display Different Image on Click

    - by user1506841
    Using XCode, I am trying to figure out how to display a different image when someone clicks or presses down on one of my buttons before being taken to a second screen. For example, I have a contact icon on my home screen. When a user clicks the icon, it should change to a darker version on tap before going to the contact screen. Any help is appreciated. -(IBAction) ButtonPressed :(id)sender { UIButton *tempButton = (UIButton *) sender; int tag = tempButton.tag; NSString *viewName; switch (tag) { case 1: [FlurryAnalytics logEvent:@"Contact-Screen"]; viewName = @"ContactScreen"; if( self.appDelegate.sound) [Click play]; [self.appDelegate moveToView:viewName]; break; } }

    Read the article

  • UIActivityIndicatorView is not display at the right time

    - by Alexandre
    I'm making a form that allows the user to enter datas in my IOS application. This form allows the user to enter a lot of repetive datas. So, sometimes, the process takes time and I would like to display a UIActivityIndicatorView during this process. Unfortunalty the spinner appears only one second or less at the end of the process, not at the beginning as expected. There is some code : - (void) manageSpinner{ spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; [spinner setCenter:CGPointMake(self.view.bounds.size.width/2.0, self.view.bounds.size.height/2.0)]; // I do this becau I'm in landscape mode UIImageView *imageView = [[UIImageView alloc]initWithFrame:self.tableView.bounds]; UIImage *image = [UIImage imageNamed:@"dark_gradiant.jpg"]; [imageView setImage:image]; [imageView addSubview:spinner]; [self.tableView addSubview:imageView]; [spinner startAnimating]; } //On click save by the user - (IBAction)save:(id)sender{ //Collect information from the form myObject.name = nameTF.text; [...] if(informations OK[...]){ //Manage spinner [self manageSpinner]; //Add : this is the long process for (int i=0; i<nbRepeatChooseByUser; i++) { [myObject register]; } //Call the delegate that will dismiss the form [self.delegate theSaveButtonOnTheAddMyObjectTVCWasTapped:self]; } } The spinner is called before the adding method but it seems to be set up after the process. Thank you, Alexandre

    Read the article

  • How do I locate the CGRect for a substring of text in a UILabel?

    - by bryanjclark
    For a given NSRange, I'd like to find a CGRect in a UILabel that corresponds to the glyphs of that NSRange. For example, I'd like to find the CGRect that contains the word "dog" in the sentence "The quick brown fox jumps over the lazy dog." The trick is, the UILabel has multiple lines, and the text is really attributedText, so it's a bit tough to find the exact position of the string. The method that I'd like to write on my UILabel subclass would look something like this: - (CGRect)rectForSubstringWithRange:(NSRange)range; Details, for those who are interested: My goal with this is to be able to create a new UILabel with the exact appearance and position of the UILabel, that I can then animate. I've got the rest figured out, but it's this step in particular that's holding me back at the moment. What I've done to try and solve the issue so far: I'd hoped that with iOS 7, there'd be a bit of Text Kit that would solve this problem, but most every example I've seen with Text Kit focuses on UITextView and UITextField, rather than UILabel. I've seen another question on Stack Overflow here that promises to solve the problem, but the accepted answer is over two years old, and the code doesn't perform well with attributed text. I'd bet that the right answer to this involves one of the following: Using a standard Text Kit method to solve this problem in a single line of code. I'd bet it would involve NSLayoutManager and textContainerForGlyphAtIndex:effectiveRange Writing a complex method that breaks the UILabel into lines, and finds the rect of a glyph within a line, likely using Core Text methods. My current best bet is to take apart @mattt's excellent TTTAttributedLabel, which has a method that finds a glyph at a point - if I invert that, and find the point for a glyph, that might work. Update: Here's a github gist with the three things I've tried so far to solve this issue: https://gist.github.com/bryanjclark/7036101

    Read the article

  • Dismiss Popover using Unwind Segue in Xcode Storyboard

    - by AlexR
    I am using Xcode 4.5 and the new iOS 6 feature to unwind segues. I am presenting a navigation view controller inside a popover which is presented programmatically from a bar button item: - (IBAction)configChartTapped:(id)sender { if (self.popover.isPopoverVisible) { [self.popover dismissPopoverAnimated:YES]; } else { UINavigationController *chartConfigNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"GrowthChartNavigationController"]; ConfigChartTypeViewController *configChartTypeViewController = (ConfigChartTypeViewController*) chartConfigNavigationController.topViewController; self.popover = [[UIPopoverController alloc]initWithContentViewController:chartConfigNavigationController]; self.popover.popoverContentSize = CGSizeMake(320, 500); self.popover.delegate = self; [self.popover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } } Next to this method I have defined a target to unwind the segue (i.e. dismissing the popover)... - (IBAction)cancelConfig:(UIStoryboardSegue *)segue { // } ... and connected it to a cancel button in the navigation view controllers's navigation bar. Connecting the cancel bar button to the cancelConfig button worked fine in Xcode. However, when running the code, nothing happens when clicking on the Cancel button despite Xcode 4.5 should be supporting dismissing popovers when unwinding segues (according to the release docs). What did I miss? Thank you!

    Read the article

  • weak or strong for IBOutlet and other

    - by Piero
    I have switched my project to ARC, and I don't understand if I have to use strong or weak for IBOutlets. Xcode do this: in interface builder, if a create a UILabel for example and I connect it with assistant editor to my ViewController, it create this: @property (nonatomic, strong) UILabel *aLabel; It uses the strong, instead I read a tutorial on RayWenderlich website that say this: But for these two particular properties I have other plans. Instead of strong, we will declare them as weak. @property (nonatomic, weak) IBOutlet UITableView *tableView; @property (nonatomic, weak) IBOutlet UISearchBar *searchBar; Weak is the recommended relationship for all outlet properties. These view objects are already part of the view controller’s view hierarchy and don’t need to be retained elsewhere. The big advantage of declaring your outlets weak is that it saves you time writing the viewDidUnload method. Currently our viewDidUnload looks like this: - (void)viewDidUnload { [super viewDidUnload]; self.tableView = nil; self.searchBar = nil; soundEffect = nil; } You can now simplify it to the following: - (void)viewDidUnload { [super viewDidUnload]; soundEffect = nil; } So use weak, instead of the strong, and remove the set to nil in the videDidUnload, instead Xcode use the strong, and use the self... = nil in the viewDidUnload. My question is: when do I have to use strong, and when weak? I want also use for deployment target iOS 4, so when do I have to use the unsafe_unretain? Anyone can help to explain me well with a small tutorial, when use strong, weak and unsafe_unretain with ARC?

    Read the article

  • Printing Pdf using AirPrint causes cut-off content

    - by Jatin Patel
    Here i am printing pdf with size 'pageSize = CGSizeMake(640, 832);'. this size is larget then A4 size page aspected. so i will cut-off some text(means it will not print whole page). while printing same pdf using MAC, it will print whole page with help of option (scale to fit). so can any one help me to come out from this problem.. is there any option in IOS sdk for scale to fit. here is my code.. -(void)printItem { NSArray *aArrPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) ; NSString *aStr = [[aArrPaths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"PropertyReport_%d.pdf",self.propertyId]]; // NSString *aStr = [[NSBundle mainBundle] pathForResource:@"TRADUZIONE HELP SECTIONS REV2" ofType:@"pdf"]; NSURL *url=[[NSURL alloc] initFileURLWithPath:aStr]; NSData *data=[[NSData alloc] initWithContentsOfURL:url]; printController = [UIPrintInteractionController sharedPrintController]; if(printController && [UIPrintInteractionController canPrintData:data]) { printController.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; //printInfo.jobName = [NSString stringWithFormat:@"New Image"]; printInfo.duplex = UIPrintInfoDuplexLongEdge; printController.printInfo = printInfo; printController.showsPageRange = YES; printController.printingItem = data; void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) { if (!completed && error) { //NSLog(@"FAILED! due to error in domain %@ with error code %u", error.domain, error.code); } }; // aWebViewPDF.hidden=FALSE; [printController presentAnimated:YES completionHandler:completionHandler]; } } Thanks Jatin Patel

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >