Search Results

Search found 3754 results on 151 pages for 'ios simulator'.

Page 78/151 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • Singleton Creation preference

    - by cwieland
    You can create singletons in a variety of ways. I am wondering which is better between these. +(ServerConnection*)shared{ static dispatch_once_t pred=0; __strong static id _sharedObject = nil; dispatch_once(&pred, ^{ _sharedObject = [[self alloc] init]; // or some other init method }); return _sharedObject; } I could see that this compiles down to something very fast. I would think that checking the predicate would be another function call. The other is: +(ServerConnection*)shared{ static ServerConnection* connection=nil; if (connection==nil) { connection=[[ServerConnection alloc] init]; } return connection; } Are there any major differences between the two? I know these are probably similar enough to not worry about it. But Just wondering.

    Read the article

  • Trouble with ID in NSString

    - by useboot
    I am trying to create something interesting in my application. So, I created an UILabel and I want to output new value. So, my code. NSString *test = @"13"; self.UserAge.text = @"Your age is %@", test; But it doesn't work. In Console-Command Mode I can do it with NSLog(); My result is "Your age is %@". But I need to output "Your age is 13". What do I should do with name? Sorry, if my question is easy for you. I am beginner. :) Thank you everyone who will answer on my question.

    Read the article

  • Is there a way to update the height of a single UITableViewCell, without recalculating the height for every cell?

    - by Chris Vasselli
    I have a UITableView with a few different sections. One section contains cells that will resize as a user types text into a UITextView. Another section contains cells that render HTML content, for which calculating the height is relatively expensive. Right now when the user types into the UITextView, in order to get the table view to update the height of the cell, I call [self.tableView beginUpdates]; [self.tableView endUpdates]; However, this causes the table to recalculate the height of every cell in the table, when I really only need to update the single cell that was typed into. Not only that, but instead of recalculating the estimated height using tableView:estimatedHeightForRowAtIndexPath:, it calls tableView:heightForRowAtIndexPath: for every cell, even those not being displayed. Is there any way to ask the table view to update just the height of a single cell, without doing all of this unnecessary work? Update I'm still looking for a solution to this. As suggested, I've tried using reloadRowsAtIndexPaths:, but it doesn't look like this will work. Calling reloadRowsAtIndexPaths: with even a single row will still cause heightForRowAtIndexPath: to be called for every row, even though cellForRowAtIndexPath: will only be called for the row you requested. In fact, it looks like any time a row is inserted, deleted, or reloaded, heightForRowAtIndexPath: is called for every row in the table cell. I've also tried putting code in willDisplayCell:forRowAtIndexPath: to calculate the height just before a cell is going to appear. In order for this to work, I would need to force the table view to re-request the height for the row after I do the calculation. Unfortunately, calling [self.tableView beginUpdates]; [self.tableView endUpdates]; from willDisplayCell:forRowAtIndexPath: causes an index out of bounds exception deep in UITableView's internal code. I guess they don't expect us to do this. I can't help but feel like it's a bug in the SDK that in response to [self.tableView endUpdates] it doesn't call estimatedHeightForRowAtIndexPath: for cells that aren't visible, but I'm still trying to find some kind of workaround. Any help is appreciated.

    Read the article

  • Comparing the values of two nsstrings

    - by user1776234
    So I have been trying to compare two NSStrings in xcode. However, it is not working. What am I doing wrong? NSString Prog are characters that are xml parsed from mysql char *cStr = "YES"; NSString *str3 = [NSString stringWithUTF8String:cStr]; if ([str3 isEqualToString:prog]) { [switch1 setOn:YES animated:YES]; } else { [switch1 setOn:NO animated:YES]; }

    Read the article

  • Manage the scrolling of just one element in a ScrollView

    - by morgan1189
    So, I have a ScrollView which has cards on it. ScrollView must be paging enabled. The goal is that the user must be able to scroll it, even if it has only one card. Since i am having the frame of ScrollView of exactly the same width and height as a picture of a card, i decided to increase the width of a ScrollView.contentSize and add one point to it. It turns out to be working fine, but it glitches a bit - when i drag the card to the left, and then grab it again it moves to right a little bit (i guess, for the value of that one point). If i increase the contentSize, the shift increases too (for example, if the content size is increased by ten, the shift value is ten points too). It really irritates me a lot and I want to get rid of it. Any advice on how to do that? Help is much appreciated. UPD: I tried to manually re-center the card in the scrollViewDidEndDecelerating but that didn't help. My guess for now is that the problem can be solved by setting the content offset to the right value (because now it's (0,0)), but I can't figure out how to do it.

    Read the article

  • What's the proper size of Default png's for iPad?

    - by David John
    I am confused by conflicting information. Most commonly I see these being the sizes quoted for the various Default images: Launch image Portrait Default-Portrait.png 768 x 1004 Launch image Portrait [email protected] 1536 x 2008 Launch image Landscape [email protected] 2048 x 1496 Launch image Landscape Default-Landscape.png 1024 x 748 Seemed like slightly unusual sizes, but I went along with it and dragged the images into the Launch images section in XCode. XCode however promptly puts little yellow triangles over these images and tell me that the sizes should be: 768x1024, 1536x2048, 1024x768 and 2048x1536 Oh and one last important bit. Do I really need to have all these images for submission to the app store? It's really not clear which images are required and which are just recommended. Mine is a Universal app btw if that makes any difference.

    Read the article

  • I can not hide keyboard by pressing return key

    - by chetan
    I have tried this: In .h file @interface TouchLabelViewController : UIViewController<UITextFieldDelegate> -(IBAction)hideKeyboard:(id)sender; In .m File -(IBAction)hideKeyboard:(id)sender{ [(UITextField*)sender resignFirstResponder]; } And also tried this in .h file -(BOOL) textFieldShouldReturn:(UITextField *)textField; in .m file -(BOOL) textFieldShouldReturn:(UITextField *)textField{ [aTextField resignFirstResponder]; return YES; } But still whenever i touch return key it does not hide keyboard.

    Read the article

  • Configure UIDatePicker with current locations time

    - by Telkitty
    I am using UIDatePicker in my current app, here is how I set a UILabel with the date time string obtained from the UIDatePicker. -(IBAction)AddTimeEnd:(id)sender { NSDate * date = [m_DateTimePicker date]; m_DateTimeLabel.text = [date description]; } Somehow the time I have entered (EST) kept on getting converted to US time in the UILabel. Does anyone know how to fix it? I would like the time entered in UIDatePicker to be consistent with the text in the label (probably the simplest way is set the locale for the UIDatePicker to be the local timezone)?

    Read the article

  • ViewDidLoad not being called with my custom UIViewController

    - by user1060500
    I have created a custom UIViewController class that creates a ScrollView at runtime that it loads into the view. See code here in the constructor of my custom UIViewController. initControl(id, canEdit); _controllers = new NSMutableArray(0); //required to keep view controllers around _scrollView = new UIScrollView(); _scrollView.BackgroundColor = UIColor.Green; this.View = _scrollView; ViewDidAppear and ViewWillAppear are called normally. ViewDidLoad is not called which I am not sure why as the view is showing up on the screen just fine. Any ideas?

    Read the article

  • managed object subclasses are not generating implementation files and are incorrectly named

    - by mkc842
    In Xcode 4.6, I generated plenty of managed object subclass files without any problem. But now that I'm trying to do it in Xcode 5, it generates only a .h file. The header file has the correct properties, but it takes the name of my project, rather than the name of the core data entity I selected. Just to be sure I hadn't forgotten something, I carefully followed these steps . What could be going on? Thanks

    Read the article

  • Uploading video file to server from iPhone

    - by SshUser
    I know how to upload images to a server running PHP, but I am stuck on uploading video. I have used this advice to upload my video file. Posting method is all ok. What I get on the server is a file of 0 bytes. My code is below: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL]; NSData *videoData = [NSData dataWithContentsOfFile:[videoURL path]]; } This videoData is passed in my POST method. What should I do instead?

    Read the article

  • How To Create a lookup Table with an NSDate for weekly range (over 5 year period)

    - by EarlyMan
    Unsure how to best achieve this. NSDate *date = [NSDate date]; I need to do a lookup on the date and return a string value. 12/17/2011 < date < 12/23/2011 return "20120101" 12/24/2011 < date < 12/30/2012 return "20120102" 12/31/2011 < date < 01/06/2012 return "20120201" ... 10/20/2012 < date < 10/26/2012 return "20122301" ... 11/02/2013 < date < 11/08/2013 return "20132301" .. for 5 years... for each week date can be any date until Dec. 2017. I do not know the logic behind the return strings so I can't simply calculate the string based on the date. The return string (converted to NSDate in the model) is used successfully as my section for my fetchedresultscontroller. I am not sure how to create a lookup table based on an NSDate or if I need some monster if/case statement.

    Read the article

  • Problem: scrolling a tableview and then select the searchbar (iphone)

    - by Samui
    Hello everyone, I've been stuck with this problem for hours and I can't see the light. Please give me a hand with this: I have a tableview and a searchbar. The searchbar is situated in the navigationbar. When I do a fast scroll of the tableview, if I select the searchbar while the tableview is still decelerating, a exception raises: Terminating app due to uncaught exception 'NSRangeException', reason: ' -[NSMutableArray objectAtIndex:]: index 31 beyond bounds for empty array' How can I stop programmatically the deceleration of the tableview? Thanks for your time!

    Read the article

  • iPhone: Localizing app icon still not supported?

    - by js_
    My app's icon includes some text. So I want to change language of the text by language or country. There is a post which says localizing app icon is not supported: http://useyourloaf.com/blog/2010/12/16/localizing-iphone-app-icon-is-not-supported.html But it was posted in December 2010, one and half years ago from now. Is it still not possible to change icon of app by language? Localizing both icon of app on device and icon on App Store are not supported? Or localizing icon only on App Store is possible?

    Read the article

  • Getting country calling prefix

    - by Telkitty
    Just wondering whether there are easy ways to retrieve country calling code from a user's phone. For example, my app would like to pre-fill country calling code for the users. If the user is located in the U.S. the code +1 will be returned, +83 for China, +61 for Australia etc. I had a look around but I could only see: NSLocale *locale = [NSLocale currentLocale]; NSString *countryCode = [locale objectForKey: NSLocaleCountryCnode]; Which returns the abbreviation for the country code, not the calling prefix? Help is appreciated!

    Read the article

  • How to automatically install an app on your iphone?

    - by wdlax11
    I'm looking to find a way to install an app automatically on an iphone. An example would be: I have an app called my.app. It's located on my desktop on my mac. When I plug in my iphone to my computer it automatically installs my.app on to my iphone. Is this possible? Any ideas of how I could possible do this or get a workaround? Or, it needs to prompt the user to install it. The app doesn't need to automatically install; it just needs to automatically prompt the user on the iPhone to ask if they want to install it or not.

    Read the article

  • Playing a sequence of sounds without gaps (iPhone)

    - by Fiire
    I thought maybe the fastest way was to go with Sound Services. It is quite efficient, but I need to play sounds in a sequence, not overlapped. Therefore I used a callback method to check when the sound has finished. This cycle produces around 0.3 seconds in lag. I know this sounds very strict, but it is basically the main axis of the program. EDIT: I now tried using AVAudioPlayer, but I can't play sounds in a sequence without using audioPlayerDidFinishPlaying since that would put me in the same situation as with the callback method of SoundServices. EDIT2: I think that if I could somehow get to join the parts of the sounds I want to play into a large file, I could get the whole audio file to sound continuously. EDIT3: I thought this would work, but the audio overlaps: waitTime = player.deviceCurrentTime; for (int k = 0; k < [colores count]; k++) { player.currentTime = 0; [player playAtTime:waitTime]; waitTime += player.duration; } Thanks

    Read the article

  • NSUTF8StringEncoding gives me this %0A%20%20%20%20%22http://example.com/example.jpg%22%0A

    - by user1530141
    So I'm trying to load pictures from twitter. If i just use the URL in the json results without encoding, in the dataWithContentsOfURL, I get nil URL argument. If I encode it, I get %0A%20%20%20%20%22http://example.com/example.jpg%22%0A. I know I can use rangeOfString: or stringByReplacingOccurrencesOfString: but can I be sure that it will always be the same, is there another way to handle this, and why is this happening to my twitter response and not my instagram response? i have also tried stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet] and it does nothing. this is the url directly from the json... 2013-11-08 22:09:31:812 JaVu[1839:1547] -[SingleEventTableViewController tableView:cellForRowAtIndexPath:] [Line 406] ( "http://pbs.twimg.com/media/BYWHiq1IYAAwSCR.jpg" ) here is my code if ([post valueForKeyPath:@"entities.media.media_url"]) { NSString *twitterString = [[NSString stringWithFormat:@"%@", [post valueForKeyPath:@"entities.media.media_url"]]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; twitterString = [twitterString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSLog(@"%@", twitterString); if (twitterString != nil){ NSURL *twitterPhotoUrl = [NSURL URLWithString:twitterString]; NSLog(@"%@", twitterPhotoUrl); dispatch_queue_t queue = kBgQueue; dispatch_async(queue, ^{ NSError *error; NSData* data = [NSData dataWithContentsOfURL:twitterPhotoUrl options:NSDataReadingUncached error:&error]; UIImage *image = [UIImage imageWithData:data]; dispatch_sync(dispatch_get_main_queue(), ^{ [streamPhotoArray replaceObjectAtIndex:indexPath.row withObject:image]; cell.instagramPhoto.image = image; }); }); } }

    Read the article

  • Why does CLLocationManager returns null locations on the iphone SDK 4 beta in the Simulator?

    - by Rigo Vides
    Hi everyone, I have this piece of code: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"Manager did update location!!"); self.currentLocation = newLocation.description; } I have this code inside a class that conforms to the CLLocationManagerDelegate. I tested earlier in sdk 3.0 and works nice (on both simulator and device). I'm testing this class on the SDK 4, in the simulator, but it gives null as a newLocation. I can't even get the NSLog for the first call. I checked other app where I use the location framework and it doesn't work either. I implemented the locationManager:didFailWithError: message also, wich is never called. Can anyone please confirm that the simulator can't do any CLLocationManager capabilities? (a link where the bug is reported as a known issue will be awesome). Is there a way to fix this? Thanks in advance.

    Read the article

  • Les appareils sous Android seraient plus sujets aux pannes matérielles que ceux sous Windows Phone ou iOS selon WDS

    Les appareils sous Android seraient plus sujets aux pannes matérielles Que Windows Phone et iOS selon WDS Le résultat d'une étude menée par la société WDS montre que les dispositifs sous Android seraient plus victimes de pannes matérielles que les autres. L'enquête a été menée pendant un an en Europe, en Amérique du Nord, en Australie et en Afrique du Sud. Elle s'appuie sur environ 600 000 appels clients et révèle que le taux de pannes des smartphones sous Android s'élèverait à 14%. Selon WDS, les pannes matérielles les plus fréquentes sur les dispositifs Android, seraient dues à la fragmentation de la plate-forme mobile et à son adoption par des constructeurs divers. ...

    Read the article

  • WeekEnd BeMyApp : spécial Téléthon, le challenge de développement d'applications mobiles concerne cette fois iOS, Android, Web et Bada

    WeekEnd BeMyApp : spécial Téléthon Le nouveau challenge de développement d'applications mobiles concerne iOS, Android, Web et Bada Une édition spéciale du challenge de développement d'applications mobiles sera organisée pour le Téléthon. Les téléspectateurs et internautes pourront suivre en direct les projets et voter pour leur application préférée. Le principe d'un WeekEnd BeMyApp est de développer des applications mobiles en 2 jours non stop. Si vous avez une bonne idée d'application mobile, mais n'y connaissez rien, vous pouvez participer au BeMyApp en la présentant le vendredi soir. Si votre idée plait, des développeurs, designers et marketeurs la dévelop...

    Read the article

  • Does language endorsement by different platforms (Android, iOS) hurt app development?

    - by MSe
    Developing iOS or OSX based applications typically requires knowledge of Objective C, since XCode is highly tailored to this language. Android, on the other hand, has chosen Java as it's preferred language for app development. Now, I know other programming languages can be used to develop applications on either platform, but lets be honest, it's a lot easier (and encouraged) to develop apps using these "native languages." As a new app developer, it seems like it would be much easier if there was a common language and development environment for developing applications on all the major platforms. This thought is probably too idealistic for a programming discussion, and I wouldn't be surprised if the SE vultures flew in to close this topic. But, here's my question. Do you think that language endorsement creates unreasonable barriers to entry for new programmers, or do you think it's beneficial in some way (if so, why) for these platforms to use completely different development environments and languages for app development?

    Read the article

  • L'intérêt des développeurs pour Android baisse en faveur de HTML 5, iOS la plateforme préférée, selon un rapport d'IDC et Appcelerator

    L'intérêt des développeurs pour Android baisse en faveur de HTML 5 iOS demeure la plateforme préférée selon un rapport d'IDC et Appcelerator Malgré le succès incontestable d'Anroid qui a franchi en fin du mois dernier le cap des 300 millions de dispositifs à travers le monde, la plateforme de Google attire peu les développeurs selon le dernier rapport du cabinet d'analyse IDC et Appcelerator. Le sondage mené auprès de 2173 développeurs du programme mobile Appcelerator sur leurs préférences et priorités de développement pour les jours à venir montre une baisse de l'intérêt de ceux-ci pour Android, passant de 85% à l'été 2011 à 79% en début 2012. Pour les tablettes Android, on constate éga...

    Read the article

  • Microsoft Office sur iOS et Android : en 2013 ? Oui, non... peut-être

    Microsoft Office pour iPhone et Android Oui, non... peut-être Soyons prudent. Rien n'est encore très clair avec le « Buzz IT » du jour : Microsoft Office débarquerait sur iOS (iPhone, iPad, iPod) et Android dès 2013. L'information vient du site américain The Verge qui tiendrait lui-même le « scoop » de sources internes à Microsoft. D'après ses sources, rien de bien révolutionnaires cependant. Microsoft Office serait disponible sous la forme d'une application gratuite (histoire de ne pas financer des concurrents ?) qui ne permettra que la lecture des fichiers Word, PowerPoint, et Excel. Toujours d'après le site, l'édition des documents ne sera possible qu'avec un compte Offi...

    Read the article

  • Intérêt croissant des développeurs pour Windows Phone au détriment de BlackBerry OS, iOS en tête, suivi de près par Android

    Intérêt croissant des développeurs pour Windows Phone au détriment de BlackBerry OS iOS en tête, suivi de près par Android Un récent rapport d'Appcelerator en collaboration avec le cabinet d'analyse IDC, montre un intérêt croissant des développeurs pour Windows Phone 7. Le sondage mené auprès de 2160 développeurs du programme Appcelerator Titanium du 2 au 3 novembre de cette année révèle que 38% (en hausse de 8 points) de ceux-ci sont « très intéressés » par le développement pour la plateforme de Microsoft. Cet attrait serait dû au partenariat entre Microsoft et Nokia. 48% des répondants ont admis que l'accord conclu entre les deux entreprises est l'élément qui les...

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >