Search Results

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

Page 50/151 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • 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

  • ERROR: iPhone Private Frameworks "No such file or directory"

    - by WrightsCS
    I have added Private Frameworks To my project. When I build in DEVICE | RELEASE everything works fine and I am able to ldid -S the application and it successfully launches on my device. However, when trying to BUILD AND GO in Simulator, I get the error "No such file or directory" as indicated below: (I also get the error twice which is strange too.) Line Location HomeProfileViewController.h:10: error: BluetoothManager/BluetoothManager.h: No such file or directory Below are the project and build settings that I currently have, maybe someone can find a mistake and let me know, that would be awesome! PROJECT SETTINGS: PRIVATE_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" PUBLIC_HEADERS_FOLDER_PATH = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include" OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050" TARGET BUILD SETTINGS: PRIVATE_HEADERS_FOLDER_PATH = "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks" FRAMEWORK_SEARCH_PATHS = "$(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks" USER_HEADER_SEARCH_PATHS = "/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include/**" OTHER_CFLAGS = "-I/Developer/SDKs/iPhoneOS.sdk/Versions/iPhoneOS3.0.sdk/include-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include-I/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include-F/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks-F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks-DMAC_OS_X_VERSION_MAX_ALLOWED=1050" Note: The quotation marks in the paths aren't actually in my project, I put them in so the site will syntax them better. Cydia

    Read the article

  • how to load multiple images in iCarousel using this code?

    - by Dany
    i'm loading bunch of images in coverflow using i carousel but i'm not getting it?..initially i got Signal sigabart issue..after i edited some of the code the view gets displayed...Am i missing something?... #import "CollectionViewController.h" @interface CollectionViewController () @property (nonatomic, retain) NSMutableArray *items; @end @implementation CollectionViewController @synthesize carousel; @synthesize items; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)dealloc { carousel.delegate = nil; carousel.dataSource = nil; [items release]; [carousel release]; [super dealloc]; } - (void)viewDidLoad { [super viewDidLoad]; carousel.type = iCarouselTypeCoverFlow2; } - (void)viewDidUnload { [super viewDidUnload]; self.carousel = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - #pragma mark iCarousel methods - (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel { return [items count]; } - (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel { return 29; } - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view { //create new view if no view is available for recycling if (view == nil) { view = [NSArray arrayWithObjects:[UIImage imageNamed:@"gal1.jpg"], [UIImage imageNamed:@"gal2.jpg"], [UIImage imageNamed:@"gal3.jpg"], [UIImage imageNamed:@"gal5.jpg"], [UIImage imageNamed:@"gal6.jpg"], [UIImage imageNamed:@"gal7.jpg"], [UIImage imageNamed:@"gal8.jpg"], [UIImage imageNamed:@"gal9.jpg"], [UIImage imageNamed:@"gal10.jpg"], [UIImage imageNamed:@"gal11.jpg"], [UIImage imageNamed:@"gal12.jpg"], [UIImage imageNamed:@"gal13.jpg"], [UIImage imageNamed:@"gal14.jpg"], [UIImage imageNamed:@"gal15.jpg"], [UIImage imageNamed:@"gal16.jpg"], [UIImage imageNamed:@"gal17.jpg"], [UIImage imageNamed:@"gal18.jpg"], [UIImage imageNamed:@"gal19.jpg"], [UIImage imageNamed:@"gal20.jpg"], [UIImage imageNamed:@"gal21.jpg"], [UIImage imageNamed:@"gal22.jpg"], [UIImage imageNamed:@"gal23.jpg"], [UIImage imageNamed:@"gal24.jpg"], [UIImage imageNamed:@"gal25.jpg"], [UIImage imageNamed:@"gal26.jpg"], [UIImage imageNamed:@"gal27.jpg"], [UIImage imageNamed:@"gal28.jpg"], } else { } return view; } @end while running on simulator i just get the screen not images?...i got stuck here....

    Read the article

  • Audio in xCode4.x is producing console warnings

    - by David DelMonte
    While the app works, I am seeing pages of console log warnings when I'm running my app on the simulator. Even Apple's "LoadPresetDemo" sample app produces the same warning messages. I don't want to reproduce them all here (about 500 lines), but here are few. I would appreciate any insight into what's going on... Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-30 17:43:00.098 appname[4175:16c03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security ... Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2011-11-30 17:43:00.245 appname[4175:16c03] Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x7b6b0780 (bundle, not loaded) 2011-11-30 17:43:00.255 appname[4175:16c03] Error loading /Library/Audio/Plug-Ins/HAL/iSightAudio.plugin/Contents/MacOS/iSightAudio: dlopen(/Library/Audio/Plug-Ins/HAL/iSightAudio.plugin/Contents/MacOS/iSightAudio, 262): Symbol not found: ___CFObjCIsCollectable

    Read the article

  • iPad: Cannot load facebook page wall in UIWebview

    - by geekay
    Its already too long i am struggling with this issue. After searching a lot I decided to post a question here. What my app does Captures photo Uploads the photo on the wall of the page Displays the facebook page wall in a UIWebview after upload is complete Everything was working as expected 4 days back :) Suddenly something went wrong :( Code NSString *facebookPageURL =@"https://m.facebook.com/pages/<myPageName>/<myPageID>?v=wall" UIWebView *webView = [[UIWebView alloc] initWithFrame:kAppFrame]; [webView setUserInteractionEnabled:NO]; [webView setBackgroundColor:[UIColor clearColor]]; webView.delegate = self; [webView setHidden: YES]; NSURL *url = [NSURL URLWithString:[facebookPageURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] relativeToURL:[NSURL URLWithString:@"http://login.facebook.com"]]; NSMutableURLRequest *request = nil; if(url) request = [NSMutableURLRequest requestWithURL:url]; [webView loadRequest:request]; [self.view addSubview:webView]; [webView reload]; [self.view bringSubviewToFront:webView]; webView = nil; Scenario If I open the url facebookPageURL in Safari in iOS Simulator it works well If I open the url in any browser on Mac it works well In webView I see a white screen If I change the facebookPageURL to remove ?v=wall to ?v=info I am stil able to see the page.(not blank screen atleast). Note 1. My facebook Page is NOT unpublished and is visible. 2. I have cross checked the facebook page permissions. I suspect there is something changed on facebook side overnight. Please guide.

    Read the article

  • Is it good choice to move a Sublayer around a view using UIPanGestureRecognizer?

    - by Pranjal Bikash Das
    I have a CALayer and as sublayer to this CALayer i have added an imageLayer which contains an image of resolution 276x183. I added a UIPanGestureRecognizer to the main view and calculation the coordinates of the CALayer as follows: - (void)panned:(UIPanGestureRecognizer *)sender{ subLayer.frame=CGRectMake([sender locationInView:self.view].x-138, [sender locationInView:self.view].y-92, 276, 183); } in viedDidLoad i have: subLayer.backgroundColor=[UIColor whiteColor].CGColor; subLayer.frame=CGRectMake(22, 33, 276, 183); imageLayer.contents=(id)[UIImage imageNamed:@"A.jpg"].CGImage; imageLayer.frame=subLayer.bounds; imageLayer.masksToBounds=YES; imageLayer.cornerRadius=15.0; subLayer.shadowColor=[UIColor blackColor].CGColor; subLayer.cornerRadius=15.0; subLayer.shadowOpacity=0.8; subLayer.shadowOffset=CGSizeMake(0, 3); [subLayer addSublayer:imageLayer]; [self.view.layer addSublayer:subLayer]; It is giving desired output but a bit slow in the simulator. I have not yet tested it in Device. so my question is - Is it OK to move a CALayer containing an image??

    Read the article

  • Custom UIProgressView drawing weirdness

    - by Werner
    I am trying to create my own custom UIProgressView by subclassing it and then overwrite the drawRect function. Everything works as expected except the progress filling bar. I can't get the height and image right. The images are both in Retina resolution and the Simulator is in Retina mode. The images are called: "[email protected]" (28px high) and "[email protected]" (32px high). CustomProgressView.h #import <UIKit/UIKit.h> @interface CustomProgressView : UIProgressView @end CustomProgressView.m #import "CustomProgressView.h" @implementation CustomProgressView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code } return self; } // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, 16); UIImage *progressBarTrack = [[UIImage imageNamed:@"progressBarTrack"] resizableImageWithCapInsets:UIEdgeInsetsZero]; UIImage *progressBar = [[UIImage imageNamed:@"progressBar"] resizableImageWithCapInsets:UIEdgeInsetsMake(4, 4, 5, 4)]; [progressBarTrack drawInRect:rect]; NSInteger maximumWidth = rect.size.width - 2; NSInteger currentWidth = floor([self progress] * maximumWidth); CGRect fillRect = CGRectMake(rect.origin.x + 1, rect.origin.y + 1, currentWidth, 14); [progressBar drawInRect:fillRect]; } @end The resulting ProgressView has the right height and width. It also fills at the right percentage (currently set at 80%). But the progress fill image isn't drawn correctly. Does anyone see where I go wrong?

    Read the article

  • Custom UITableView headerView disappears after memory warning

    - by psychotik
    I have a UITableViewController. I create a custom headerView for it's tableView in the loadView method like so: (void)loadView { [super loadView]; UIView* containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, height * 2 )]; containerView.tag = 'cont'; containerView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(padding, height, width, height); ... //configure UIButton and events UIImageView* imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"] highlightedImage:[UIImage imageNamed:@"highlight.png"]]; imageView.frame = CGRectMake(0, 0, width, height ); ... //configure UIImageView [containerView addSubview:button]; [containerView addSubview:imageView]; self.tableView.tableHeaderView = containerView; [imageView release]; [containerView release]; } None of the other methods (viewDidLoad/Unload, etc) are overloaded. This controller is hosted in a tab. When I switch to another tab and simulate a memory warning, and then come back to this tab, my UITableView is missing my custon header. All the rows/section are visible as I would expect. Putting a BP in the loadView code above, I see it being invoked when I switch back to the tab after the memory warning, and yet I can't actually see the header. Any ideas about what I'm missing here? EDIT: This happens on the device and the simulator. On the device, I just let a memory warning occur by opening a bunch of different apps while mine is in the background.

    Read the article

  • UIWebView loading/randering error after resize

    - by user1343869
    I have a screen with 2 UIWebView. The user can drag the views left and right to make the right and left view bigger (respectively) and the other one smaller (like UISplitView but customized and self made). I'm loading .html pages from strings and local .css files. After resizing the UIWebView If I load a new page there will be a black or white stripe on the right side of the UIWebView. This stripe is part of the web view (not a space between the views), and if I scroll the webView up and then down, the stripe will vanish and the page will be presented correctly. This issue occurs only in iOS 6 and only on the device (on the simulator it doesn't occur). Some notes: - The .css file contains elements with fixed position. Changing to absolute position didn't solve the problem but changed it: the black stripre occured during the drag. - As slower the drag is, the stripe will be bigger. - After resize the page is presented correctly, only when I load a new page the stripe is shown. - The time between resizing the web view and loading a page doesn't matter, it can be straight away or after couple of minutes. Now, as a workaround I create a new UIWebView and copy the old properties to the new. But than I need to reload the presented page which make a white blink... Any idea why does it happens, and how to fix it?

    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

  • pass objective c object and primitive type into a void *

    - by user674669
    I want to pass 2 variables: UIImage * img int i into another method that only takes a (void *) I tried making a C struct containing both img and i struct MyStruct { UIImage *img; int i; } but xcode gives me an error saying "ARC forbids Objective-C objects in structs or unions" The next thing I tried is to write an objective-c class MyStruct2 containing img and i, alloc-initing an instance of it and typecasting it as (__bridge void*) before passing it to the method. Seems little involved for my use case. Seems like there should be a better way. What's the simplest way to achieve this? Thank you. Edit based on comments: I have to use void * as it is required by the UIView API. I created a selector as mentioned by UIVIew API + (void)setAnimationDidStopSelector:(SEL)selector Please see documentation for setAnimationDidStopSelector at http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html . It says ... The selector should be of the form: - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context I want to pass both img and i into the (void *)context argument.

    Read the article

  • Initial text and paperclipped-URL for action in UIActivityViewController & UIActivityItemSource?

    - by Benjamin Kreeger
    Finally been making it through Apple's (rather dismal) documentation on the new UIActivityViewController class and the UIActivityItemSource protocol, and I'm trying to send different data sets to different actions called from the activity view. To simplify things, I'm looking at two things. A Facebook posting action, which should say "Check this out!" and also attach a URL to the post (with that cute little paperclip). A Twitter posting action, which should say "Check this out, with #hashtag!" and also attach that same URL (with the same paperclip). Here's the code I've got implemented right now. - (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType { if ([activityType isEqualToString:UIActivityTypePostToFacebook]) { return @"Check this out!"; } else if ([activityType isEqualToString:UIActivityTypePostToTwitter]) { return @"Check this out, with #hashtag!"; } return @""; } - (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController { return @""; } And then when I set up this activity view controller (it's in the same class), this is what I do. UIActivityViewController *activityView = [[UIActivityViewController alloc] initWithActivityItems:@[self] applicationActivities:nil]; [self presentViewController:activityView animated:YES completion:nil]; My dilemma is how to attach that NSURL object. It's relatively easy when calling the iOS 6 SL-class posting modals; you just call the individual methods to attach a URL or an image. How would I go about doing this here? I'll note that instead of returning NSString objects from -activityViewController:itemForActivityType, if I return just NSURL objects, they show up with that paperclip, with no body text in the post. If I return an array of those two items, nothing shows up at all.

    Read the article

  • Implement user authentication against remote DB with a Web Service

    - by Juan González
    I'm just starting reasearch about the best way to implement user authentication within my soon-to-be app. This is what I have so far: A desktop (Windows) application on a remote server. That application is accessed locally with a browser (it has a web console and MS SQL Server to store everything). The application is used with local credendials stored in the DB. This is what I'd like to accompllish: Provide access to some information on that SQL Server DB from my app. That access of course must be granted once a user has id himself with valid credentials. This is what I know so far: How to create my PHP web service and query info from a DB using JSON. How to work with AFNetworking libraries to retrieve information. How to display that info on the app. What I don't know is which could be the best method to implement user authentication from iOS. Should I send username and password? Should I send some hash? Is there a way to secure the handshake? I'd for sure appreciate any advise, tip, or recommendation you have from previous experience. I don't want to just implement it but instead I want to do it as good as possible.

    Read the article

  • Swipe left/right to push next/previous details view

    - by Youssef
    I am working on a ios application, using storyboard. I have a simple table view with rows. Each row has a "key" string to identify it. When the user clicks on a row I push the next view "DetailsViewController" and pass the "key" as a parameter in the prepareForSegue method. The data in the second view will change based on the "key" passed. In the "DetailsViewController" I want to add a swipe gesture, when the user swipes right, I want to push the next details view. It will be as if he clicked on the next row in the table view. So to rephrase, the user has 2 ways of switching between items: he can click the item in the table view and the details view will show, he can then go back and select another item. Or he can click on a row, and in the details view he can swipe left and right to see the previous/next item. i added the uigesture recognizer: UISwipeGestureRecognizer *recognizer; recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)]; [recognizer setDirection:UISwipeGestureRecognizerDirectionRight]; [[self view] addGestureRecognizer:recognizer]; - (void) handleSwipe:(UISwipeGestureRecognizer *) sender { //I want to go to the next item in the tableview } I hope I was clear. Thank you.

    Read the article

  • Really cool way to create custom UITabBar for iPhone app?

    - by ludicco
    Hi, I am doing a lot of researching lately about how to get a different looking with nice effects UITabBar on my iPhone app, but unfortunately I am only finding things on how to replace background color etc. Well, I've checked out this app called Momento which is pretty cool and presents a very slick tabBar: So there are a couple of elements here I would like to ask you guys if you could help me by giving me the right directions on how to get a similar effect :) Arrow above items: as you can see this app has this animated arrow that runs above the selected item with a very smooth animation. Selected Stated of the item's image is not that blue-ish default one neither the default state which displays in a different shade of brown and gray version. nice Items separators with beveled vertical lines. diferrent background image for the tabBar different height for the tabBar At this point after some research I am able to set the height and background image by subclassing UITabBarController but I'm still not sure on how to accomplish the other items specially the first one related to the nice arrow effect. If someone knows about a very good tutorial on how to do this it would be great for clarifying what can or can't be done by subclassing the UITabBarController and specially if can be done in Interface Builder :) I am just starting on this world off app development for iOS so if you could help me on that it would be really appreciated Thanks a lot in advance

    Read the article

  • How do you populate a UIImage view with ASIHTTPRequest given @2x?

    - by Jonathan Page
    I've been trying to load images from a url using ASIHTTPRequest but I always come up with a blank UIImage. I think it might have something to do with iOS automatically choosing the @2x named version of images or vica versa. [ASIHTTPRequest setDefaultCache:[ASIDownloadCache sharedCache]]; NSString *url_string = [NSString stringWithFormat:@"http://173.246.100.185/%@", [eventDictionary objectForKey:kEventDescriptionImageURLKey]]; NSURL *url = [NSURL URLWithString:url_string]; __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDownloadCache:[ASIDownloadCache sharedCache]]; [request setCachePolicy:ASIAskServerIfModifiedCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy]; [request setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy]; [request setSecondsToCache:86400]; [request setDelegate:self]; [request setCompletionBlock:^{ NSLog(@"Successful Update"); [self makeAssignment]; }]; [request setFailedBlock:^{ NSError *error = [request error]; NSLog(@"%@", [error localizedDescription]); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Update Failed" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; }]; [request startAsynchronous]; NSLog(@"%@", url_string); The makeAssignment method is below. NSString *url_string = [NSString stringWithFormat:@"http://173.246.100.185/%@", [eventDictionary objectForKey:kEventDescriptionImageURLKey]]; NSURL *url = [NSURL URLWithString:url_string]; downloadedImage = [[UIImage alloc] initWithContentsOfFile:[[ASIDownloadCache sharedCache] pathToCachedResponseDataForURL:url]]; NSLog(@"%@", downloadedImage); NSLog(@"%@", [[ASIDownloadCache sharedCache] pathToCachedResponseDataForURL:url]); Nothing I do, including naming images @2x on the server or providing both versions, gets it to load. Any ideas? Has anyone done this before? When I load them locally (from within the package) I don't have any issues. Thanks!

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >