Search Results

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

Page 69/151 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • Autorelease and properties

    - by ganuke
    I have few questions to ask about the following class #import <Cocoa/Cocoa.h> @interface SomeObject { NSString *title; } @property (retain) NSString *title; @end implementation SomeObject @synthesize title; -(id)init { if (self=[super init]) { self.title=[NSString stringWithFormat:@"allyouneed"]; } return self; } -(void)testMethod{ self.title=[[NSString alloc] init] ; } -(void)dealloc { self.title=nil; [super dealloc]; } In the .h file do we need to declare the title and sub when we add the property. is it not enough to add the @property (retain) NSString *title; line. 2.Do i need to autorelease both assignment to title in the init and testMethod. if So why? Can some one explain these things to me.

    Read the article

  • Why do I get "2010-01-01 00:00:00 +900" from "2010-12-31 15:00:00 +000"?

    - by mikezang
    I have NSDate, it will be shown as below if I used NSLog(@"%@", date.description); 2010-12-31 15:00:00 +0000 it will be shown as if I used NSLog(@"%@", [date descriptionWithLocale:[[NSLocale currentLocale] localeIdentifier]]); Saturday, January 1, 2011 12:00:00 AM Japan Standard Time But it will be show as below if I used NSLog(@"%@", [date formattedDateString]); 2010-01-01 00:00:00 +0900 Where do I make mistake? (NSString *)formattedDateString { return [self formattedStringUsingFormat:@"YYYY-MM-dd HH:mm:ss ZZZ"]; } (NSString *)formattedStringUsingFormat:(NSString *)dateFormat { NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:dateFormat]; NSString *ret = [formatter stringFromDate:self]; [formatter release]; return ret; }

    Read the article

  • what's the right way to cause a subview to redraw when the device orientation changes?

    - by RobertL
    I have a view controller with a view and one subview. When the device orientation changes the view auto-redraws but the subview doesn't. If I explicitly do [subview setNeedsDisplay] it redraws but I don't have a logical place to put that call in my code. And, since I don't have to explicitly tell the view to redraw, it seems counter-intuitive to tell the subview to redraw. Is there a way to make the subview auto-redraw when the view redraws?

    Read the article

  • Which button called the function?

    - by StoneBreaker
    I have two buttons which call the same function. That functions signature is - (IBAction)eraseTextField {...} I would like to figure out what button called the function. So I would like for the functions signature to be something like - (IBAction)eraseTextField: (id)sender {...}. Is there a way for the system to know to send the id of the calling object to a function that it calls? Thanks for the help.

    Read the article

  • Attach GestureRecogniser to multiple imageviews

    - by AppleDeveloper
    Something strange I encountered today while attaching same gesture recogniser to multiple image views. It gets attached to only the last one, in other words, it can be attached to only one view! I had to create multiple gesture recognisers to meet my requirements. Following is what I have done. Am I doing correct? Is that's the only way to attach recognisers to the multiple imageviews? Please note that I don't want to use UITableView or UIVIew and put all imageviews in it and attach gesture recogniser to only UITableView or UIVIew. I have all image scattered and I have to detect which image is being dragged. Thanks. [imgView1 setUserInteractionEnabled:YES]; [imgView1 setMultipleTouchEnabled:YES]; [imgView2 setUserInteractionEnabled:YES]; [imgView2 setMultipleTouchEnabled:YES]; [imgView3 setUserInteractionEnabled:YES]; [imgView3 setMultipleTouchEnabled:YES]; [imgView4 setUserInteractionEnabled:YES]; [imgView4 setMultipleTouchEnabled:YES]; [imgView5 setUserInteractionEnabled:YES]; [imgView5 setMultipleTouchEnabled:YES]; [imgView6 setUserInteractionEnabled:YES]; [imgView6 setMultipleTouchEnabled:YES]; //Attach gesture recognizer to each imagviews gestureRecognizer1 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer1.delegate = self; gestureRecognizer2 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer2.delegate = self; gestureRecognizer3 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer3.delegate = self; gestureRecognizer4 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer4.delegate = self; gestureRecognizer5 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer5.delegate = self; gestureRecognizer6 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer6.delegate = self; [imgView1 addGestureRecognizer:gestureRecognizer1]; [imgView2 addGestureRecognizer:gestureRecognizer2]; [imgView3 addGestureRecognizer:gestureRecognizer3]; [imgView4 addGestureRecognizer:gestureRecognizer4]; [imgView5 addGestureRecognizer:gestureRecognizer5]; [imgView6 addGestureRecognizer:gestureRecognizer6];

    Read the article

  • Why does XCode keep downloading old deleted profiles and duplicates of the same profile?

    - by Piepants
    If I refresh the profiles in XCode it: a) Pulls down ones that no longer exist. Profiles that have been deleted from the portal and are no longer there b) Pulls down multiple copies of the same profile. If I add a new device and then update the profiles to include that new device. Then XCode will pull down the new updated profile but also the same profile with an older date (even though the portal only shows one, the latest). If I delete them them XCode they re-appear. I'm having problems getting push notifications to work with an ad-hoc distrubtion and so want to ensure I am build with the latest profiles. This behaviour of XCode is irritating at least, and possibly the source of my problems at worst.

    Read the article

  • Load local Html file doesn't refer the js file in UIWebView

    - by Hero Vs Zero
    I am working with UIWebView project and I want to load an HTML file from a project resource. It is working fine when I run from the URL, but when I view the HTML file locally, JS files are not loaded. Loading the local HTML local file doesn't refer to js files in UIWebView. Here's my code to load the HTML file project local resource and does't refer the js file: NSString *path = [[NSBundle mainBundle] pathForResource:@"textfile" ofType:@"txt"]; NSError *error = nil; NSString *string = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error]; NSString *path1 = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path1]; NSLog(@"%@ >>> %@",baseURL,path); [webview loadHTMLString:string baseURL:baseURL]; This code doesn't find JS files in UIWebView, even though it loads image files from the project resource successfully.

    Read the article

  • preventing selection on MKPointAnnotation

    - by Derek
    Is there a way to prevent an annotation in a MKMapView instance from being enabled. In other words, when the user taps the red pin on the map, is there a way to prevent it from highlighting the pin. Right now the pin turns dark when touched... Edit: I'm using the following code to return the MKPinAnnotationView // To future MKMapView users - Don't forget to set _mapView's delegate _mapView.delegate = self; _annotation = [[MKPointAnnotation alloc] init]; _annotation.coordinate = myLocation; [_mapView addAnnotation:_annotation]; -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation{ MKPinAnnotationView *pin = [[MKPinAnnotationView alloc] initWithAnnotation:_annotation reuseIdentifier:@"id"]; pin.enabled = NO; return pin; }

    Read the article

  • Custom URL for the Birdhouse app

    - by bryanjclark
    I'd like to figure out the custom URL scheme for the Birdhouse iPhone app, but there doesn't seem to be any documentation. Birdhouse is an app to store drafts for Twitter. I'd like to send it a string of text, and I know that it's possible: Birdhouse responds to the URL birdhouse:/// The Twitter app sends drafts to Birdhouse if it's installed on your phone. I've figured out the birdhouse:/// part, but how do I send the text?

    Read the article

  • How to hadle a tags inside another tags in NSXMLParser

    - by SimpleMan
    I have a file: <xml> <component>something <system>somethingDeeper <value>somethingDeepest</value> </system> </component> <component>somethinfDifferent <value>somethingDifferentDeeper</value> </component> <value>somethingNew</value> </xml> So i want to distinguish what is inside another tag (ex. <system>) what is not. How to do this with NSXMLParser ? I currently use BOOL ivar's but this is a lot of tags and this is not as elegant as i want it to be. I know that NSXMLParser is a SAX parser and i understand that. In above example I will be enter to didEndElement method three times with: elementName equal value Is there a more elegant way to distinguish what entry was from <component> tag above what not?

    Read the article

  • Change UIView alpha value

    - by Ask
    I'm trying to create an UIView and change its alpha property to simulate backlight change. Here is my code if (TransparentView == nil) { TransparentView = [[UIView alloc] initWithFrame:self.view.bounds]; TransparentView.backgroundColor = [UIColor whiteColor]; self.view = TransparentView; } start=start+appDelegate.OnOffTime; TransparentView.alpha = 0.2; float step = 1.0 / ( appDelegate.OnOffTime * 100); for (float f = 0; f < 1; f=f+step) { TransparentView.alpha = (CGFloat)(1 - f); [NSThread sleepForTimeInterval:0.01]; } Both TransparentView.alpha = 0.2 and TransparentView.alpha = (CGFloat)(1 - f) do change TransparentView.alpha, but only TransparentView.alpha = 0.2 changes real device "brightness'. What am I doing wrong?

    Read the article

  • Localizing a plist with grouped data

    - by Robert Altman
    Is there a way to localize a plist that contain hierarchical or grouped data? For instance, if the plist contains: Book 1 (dictionary) Key (string) Name (string) Description (localizable string) Book 2 (dictionary) Key (string) Name (string) Description (localizable string) (etcetera...) For the sake of the example, the Key and Name should not be translated (and preferably should not be duplicated in multiple localized property lists). Is there a mechanism for providing localizations for the localizable Description field without localizing the entire property list? The only other strategy that came to my mind is to store a lookup key in the description field and than use that to retrieve the localized text via NSLocalizedString(...) Thanks.

    Read the article

  • NSXMLParser values not being retained.

    - by user574947
    This is similar to my previous question. I didn't get an answer, maybe by changing the question I might get an answer. Here is my parsing code: -(void) parser:(NSXMLParser *) parser didStartElement:(NSString *) elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *) qName attributes:(NSDictionary *) attributeDict { if ([elementName isEqualToString:kimgurl] || [elementName isEqualToString:kone_x] || [elementName isEqualToString:kone_y] || [elementName isEqualToString:kone_radius] || [elementName isEqualToString:ktwo_x] || [elementName isEqualToString:ktwo_y] || [elementName isEqualToString:ktwo_radius]) { elementFound = YES; theItems = [[Items alloc] init]; } } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if([elementName isEqualToString:kimgurl]) { theItems.imageURL = self.currentValue; [self.currentValue setString:@""]; } else if([elementName isEqualToString:kone_x]) { theItems.iOne_X = self.currentValue; [self.currentValue setString:@""]; } else if([elementName isEqualToString:kone_y]) { theItems.iOne_Y = self.currentValue; [self.currentValue setString:@""]; } else if([elementName isEqualToString:kone_radius]) { theItems.iOne_Radius = self.currentValue; [self.currentValue setString:@""]; } else if([elementName isEqualToString:ktwo_x]) { theItems.iTwo_X = self.currentValue; [self.currentValue setString:@""]; } else if([elementName isEqualToString:ktwo_y]) { theItems.iTwo_Y = self.currentValue; [self.currentValue setString:@""]; } else if([elementName isEqualToString:ktwo_radius]) { theItems.iTwo_Radius = self.currentValue; [self.currentValue setString:@""]; } } -(void) parserDidEndDocument:(NSXMLParser *)parser { NSLog(@"enddocument: %@", theItems.imageURL); } -(void)parser:(NSXMLParser *) parser foundCharacters:(NSString *)string { if (elementFound == YES) { if(!currentValue) { currentValue = [NSMutableString string]; } [currentValue appendString: string]; } } When I get to parserDidEndDocument. The theItems class is empty. Here is Items.h #import <Foundation/Foundation.h> @interface Items : NSObject { @private //parsed data NSString *imageURL; NSString *iOne_X; NSString *iOne_Y; NSString *iOne_Radius; NSString *iTwo_X; NSString *iTwo_Y; NSString *iTwo_Radius; } @property (nonatomic, retain) NSString *imageURL; @property (nonatomic, retain) NSString *iOne_X; @property (nonatomic, retain) NSString *iOne_Y; @property (nonatomic, retain) NSString *iOne_Radius; @property (nonatomic, retain) NSString *iTwo_X; @property (nonatomic, retain) NSString *iTwo_Y; @property (nonatomic, retain) NSString *iTwo_Radius; @end here is Items.m #import "Items.h" @implementation Items @synthesize imageURL; @synthesize iOne_X; @synthesize iOne_Y; @synthesize iOne_Radius; @synthesize iTwo_X; @synthesize iTwo_Y; @synthesize iTwo_Radius; -(void)dealloc { [imageURL release]; [iOne_X release]; [iOne_Y release]; [iOne_Radius release]; [iTwo_X release]; [iTwo_Y release]; [iTwo_Radius release]; [super dealloc]; } @end here is my RootViewController.h #import <UIKit/UIKit.h> @class Items; @interface RootViewController : UIViewController <NSXMLParserDelegate> { NSMutableData *downloadData; NSURLConnection *connection; BOOL elementFound; NSMutableString *currentValue; NSMutableDictionary *pictures; //---xml parsing--- NSXMLParser *xmlParser; Items *theItems; NSMutableArray *aItems; } @property (nonatomic, retain) Items *theItems; @property (nonatomic, retain) NSMutableArray *aItems; @property (nonatomic, retain) NSMutableString *currentValue; @property (nonatomic, retain) NSMutableData *downloadData; @property (nonatomic, retain) NSURLConnection *connection; @end xml file example <?xml version="1.0" encoding="utf-8"?> <data> <test> <url>url</url> <one_x>83</one_x> <one_y>187</one_y> <one_radius>80</one_radius> <two_x>183</two_x> <two_y>193</two_y> <two_radius>76</two_radius> </test> </data>

    Read the article

  • inserting time delay with cocos2d

    - by KDaker
    I am trying to add several labels that appear sequentially with a time delay between each. The labels will display either 0 or 1 and the value is calculated randomly. I am running the following code: for (int i = 0; i < 6; i++) { NSString *cowryString; int prob = arc4random()%10; if (prob > 4) { count++; cowryString = @"1"; } else { cowryString = @"0"; } [self runAction:[CCSequence actions:[CCDelayTime actionWithDuration:0.2] ,[CCCallFuncND actionWithTarget:self selector:@selector(cowryAppearWithString:data:) data:cowryString], nil]]; } the method that makes the labels appear is this: -(void)cowryAppearWithString:(id)sender data:(NSString *)string { CCLabelTTF *clabel = [CCLabelTTF labelWithString:string fontName:@"arial" fontSize:70]; CGSize screenSize = [[CCDirector sharedDirector] winSize]; clabel.position = ccp(200.0+([cowries count]*50),screenSize.height/2); id fadeIn = [CCFadeIn actionWithDuration:0.5]; [clabel runAction:fadeIn]; [cowries addObject:clabel]; [self addChild:clabel]; } The problem with this code is that all the labels appear at the same moment with the same delay. I understand that if i use [CCDelayTime actionWithDuration:0.2*i] the code will work. But the problem is that i might also need to iterate this entire for loop and have the labels appear again after they have appeared the first time. how is it possible to have actions appear with delay and the actions dont always follow the same order or iterations???

    Read the article

  • How to avoid truncation of text with UITableViewCellStyleValue2

    - by Regan
    I use this code to make my UITableViewCells cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease]; If you're unfamiliar with UITableViewCellStyleValue2, the main text is shown, and then the detail text is shown after it, generally in a different color. However, when I do this, my main text is truncated, if it is longer than a short word. I want to force it to not truncate the main text and show the entire main text, and then the detail text after it. How can I do that?

    Read the article

  • NSFetchedResultsController sort different sections differently (ascending/descending)?

    - by PartiallyFinite
    In my app, I have a task list (no, it's not just another todo app), and I display the tasks in a UITableView using an NSFetchedResultsController. Here is the relevant initialisation code: NSSortDescriptor *dueDateSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"due" YES]; NSSortDescriptor *completionSortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"completed" ascending:YES]; [fetchRequest setSortDescriptors:[NSArray arrayWithObjects:completionSortDescriptor, dueDateSortDescriptor, nil]]; _fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:context sectionNameKeyPath:@"completed" cacheName:nil]; What this does is sorts the tasks such that I have an incomplete tasks section at the top, sorting with the tasks due first on top, and tasks due later further down. This all works. However, this means that the second section, the one with the completed tasks, also sorts this way, so the earliest due tasks are on top. What I want to do is change it so the second section sorts the other way around (in descending order), but the first section stays sorted in ascending order. Is this even possible? How would I go about this? Why I want to do this: The way it currently works, the tasks at the top of the second section (and therefore the most visible) are the ones that were completed ages ago. It is more likely that the user would want to see the tasks that are more recently completed (and uncheck one if it was accidentally checked), and presumably the tasks with a more recent due date were more recently completed. I am happy to add a separate completion date field to the Core Data task object if necessary (This isn't a shipping application yet, so I can change the data format however I like).

    Read the article

  • UIButton title disappears on touch

    - by psychotik
    I want a touchable UILabel, but since that's not possible I decided to create a UIButton of type UIButtonTypeCustom. It looks how I want it to look, but when I touch it, the title disappears. I tried setting the title for state UIControlStateHighlighted but that didn't help. I know I'm doing something really silly here, but can't figure it out. I tried a few things (commented in the code below) which didn't seem to help. Here's how I'm configuring the button: UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, width, height); button.clearsContextBeforeDrawing = YES; button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; button.enabled = YES; button.hidden = NO; button.highlighted = NO; button.opaque = YES; button.selected = NO; button.userInteractionEnabled = YES; button.showsTouchWhenHighlighted = NO; [button setTitle:@"Hello World" forState:UIControlStateNormal]; button.titleLabel.font = [UIFont boldSystemFontOfSize:16]; button.titleLabel.textColor = [UIColor blackColor]; // Things I tried that didn't help //[button setBackgroundColor:[UIColor clearColor]]; //button.titleLabel.text = @"Hello World"; //[button setTitle:@"Hello World" forState:UIControlStateHighlighted]; Any ideas?

    Read the article

  • Getting JSON object from php authentication objective c

    - by iError
    I am trying to authenticate using the below code NSString *urlAsString =[NSString stringWithFormat:@"http://www.myurl.com/abc/authenticate.php"]; NSURL *url = [NSURL URLWithString:urlAsString]; NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url]; [urlRequest setTimeoutInterval:30.0f]; [urlRequest setHTTPMethod:@"POST"]; [urlRequest addValue:@"test" forHTTPHeaderField:@"m_username" ]; [urlRequest addValue:@"123" forHTTPHeaderField:@"m_password" ]; [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self]; NSOperationQueue *queue = [[NSOperationQueue alloc] init]; [NSURLConnection sendAsynchronousRequest:urlRequest queue:queue completionHandler:^(NSURLResponse *response,NSData *data, NSError *error) { if ([data length] >0 && error == nil){ html = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"HTML = %@", html); receivedData = [NSMutableData data]; } else if ([data length] == 0 && error == nil){ NSLog(@"Nothing was downloaded."); } else if (error != nil){ NSLog(@"Error happened = %@", error); } }]; // Start loading data NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self]; if (theConnection) { // Create the NSMutableData to hold the received data receivedData = [NSMutableData data]; } else { // Inform the user the connection failed. } My username password is correct, I think I am not making the proper call thats why I dont get the desired results and the web service is receiving the null parameters. What can be the issue? Any help appreciated.

    Read the article

  • Slide through view controllers but not with the UISwipeGestureRecognizer

    - by JoeyT
    Here is my issue, i got 5 view controllers and i can switch between them trough swipe with the UISwipeGestureRecognizer class and xcode's storyboard. So this works, but, i dont like the slide effect. I like to make it in a way so you can exactly slide the view to another by dragging it. For example, like this slider in JS: http://dimsemenov.com/plugins/royal-slider/ Can anyone send me in the right direction? I searched on the internet but i cant find any functions or tutorial on how to do this. Thanks in advance! Edit: Im not looking the scroll view. Because this will result in some white spaces when i have 3 slides vertical for slide 1 and 5 slides vertical for slide 2. Hope u guys can follow me! Edit: This is what i try to accomplish. **

    Read the article

  • Dynamically showing TableView or DetailView

    - by Niels
    From my TableView I dynamically want to show either a TableView or a DetailView (new segue), based on the cell's content. I setup two segues from the TableView to different DetailViews and one segue from the TableViewCell to the TableView. I have almost completed the implementation using performSegueWithIdentifier: (see below), but there is one struggling issue remaining: after I call [self dismissModalViewControllerAnimated:YES]; on the DetailView it returns to an empty TableView . I assume because the Storyboard segue from the UITableViewCell is performed. By clicking the back button I return to my original (parent) TableView data. Any suggestions for this work? - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSLog(@"%s", __PRETTY_FUNCTION__); NSString *type = [[self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row] valueForKey:@"cell_type"]; NSLog(@"cell_type: %@", type); if([[segue identifier] isEqualToString:@"DetailSegue"]) { UIViewController *detailViewController = [segue destinationViewController]; detailViewController.game = [self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row]; } else if ... } else if([[segue identifier] isEqualToString:@"TableViewSegue"]){ if([type isEqualToString:@"TableView"]){ //Create child ViewController, a custom ViewController with custom initWithId:Title: CategoryViewController *categoryViewController = [[segue destinationViewController] initWithId:categoryId Title:categoryTitle]; } } }

    Read the article

  • Using resources with the same name in Xcode

    - by Roberto
    Is there a way to add multiple resources with the same name to an Xcode project and have 1 of them take priority over the others? Example: I added 2 files, both called icon.png, to an Xcode project. They are on different folders in the file system (Folder1/icon.png and Folder2/icon.png) and on different groups in Xcode. Is there a way to tell Xcode to have Folder2/icon.png take priority over Folder1/icon.png? And if only 1 icon.png exists, then use that one. Thanks. EDIT (2010-12-23): You can have multiple files with the same name in an Xcode project even if they are not in separate folder references, but they are in separate groups. Once compiled, the app bundle (which will be flat with no folders in it), will only have one copy of the file (icon.png). How do you pick which copy of the file to use? I was told that you can do this for BlackBerry. It works something like this: The compiler will go down the list of files in the project and start adding them to the app bundle. If it sees a duplicate, it will overwrite it (or not), so the files at the bottom (or at the top) will have higher precedence and will be the final bundle.

    Read the article

  • NotificationCenter Widget Failed To Use CoreLocation

    - by James Ye
    I'm writing a notification center widget, and it had to use location information. In normal apps I use CoreLocation and it works fine. But in my widget, I tried to locationServicesEnabled but it didn't go to the callback functions, and the authorizationStatus is always kCLAuthorizationStatusNotDetermined, and the authorize setting didn't show up in Setting - location service. I already set the delegate to the class. The system's Yahoo weather widget can auto locating and it uses CoreLocation too, so the widget do have ability to use location service. Why CoreLocation doesn't work on my widget?

    Read the article

  • 2 Shaders using the same vertex data

    - by Fonix
    So im having problems rendering using 2 different shaders. Im currently rendering shapes that represent dice, what i want is if the dice is selected by the user, it draws an outline by drawing the dice completely red and slightly scaled up, then render the proper dice over it. At the moment some of the dice, for some reason, render the wrong dice for the outline, but the right one for the proper foreground dice. Im wondering if they aren't getting their vertex data mixed up somehow. Im not sure if doing something like this is even allowed in openGL: glGenBuffers(1, &_vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glBufferData(GL_ARRAY_BUFFER, numVertices*sizeof(GLfloat), vertices, GL_STATIC_DRAW); glEnableVertexAttribArray(effect->vertCoord); glVertexAttribPointer(effect->vertCoord, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(effect->toon_vertCoord); glVertexAttribPointer(effect->toon_vertCoord, 3, GL_FLOAT, GL_FALSE, 0, 0); im trying to bind the vertex data to 2 different shaders here when i load my first shader i have: vertCoord = glGetAttribLocation(TexAndLighting, "position"); and the other shader has: toon_vertCoord = glGetAttribLocation(Toon, "position"); if I use the shaders independently of each other they work fine, but when i try to render both one on top of the other they get the model mixed up some times. here is how my draw function looks: - (void) draw { [EAGLContext setCurrentContext:context]; glBindVertexArrayOES(_vertexArray); effect->modelViewMatrix = mvm; effect->numberColour = GLKVector4Make(numbers[colorSelected].r, numbers[colorSelected].g, numbers[colorSelected].b, 1); effect->faceColour = GLKVector4Make(faceColors[colorSelected].r, faceColors[colorSelected].g, faceColors[colorSelected].b, 1); if(selected){ [effect drawOutline]; //this function prepares the shader glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0); } [effect prepareToDraw]; //same with this one glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0); } this is what it looks like, as you can see most of the outlines are using the wrong dice, or none at all: links to full code: http://pastebin.com/yDKb3wrD Dice.mm //rendering stuff http://pastebin.com/eBK0pzrK Effects.mm //shader stuff http://pastebin.com/5LtDAk8J //my shaders, shouldn't be anything to do with them though TL;DR: trying to use 2 different shaders that use the same vertex data, but its getting the models mixed up when rendering using both at the same time, well thats what i think is going wrong, quite stumped actually.

    Read the article

  • Xcode App Crash-When connecting to the ODATA services [on hold]

    - by user3685677
    Can someone help me resolving the following issue: When trying to connect from iPad app to SAP ECC system through ODATA channel services via SUP, it is allowing me to login for the first time and could retrieve the data successfully from SAP system. But when I logout and try logging in again with the same session, application gets crashed. Below is the crash report for your reference. I am using SDM Parser to connect the SAP system. SDMODataServiceDocumentParser *sdmDocParser = [[SDMODataServiceDocumentParser alloc] init]; [sdmDocParser parse:aServiceDocument]; m_serviceDocument = sdmDocParser.serviceDocument; //Load the object with metadata xml: SDMODataMetaDocumentParser *sdmMetadataParser = [[SDMODataMetaDocumentParser alloc] initWithServiceDocument:m_serviceDocument]; [sdmMetadataParser parse:aMetadata]; After initiated the service, setting the URL. [service setServiceDocumentUrl:m_serviceDocumentURL]; Using SDMconnectivityhelper to connect the URL id<SDMRequesting> serviceDocumentRequest2 = [connectivityHelper executeBasicSyncRequestWithQuery3:[[ODataQuery alloc]initWithURL:[NSURL URLWithString:encodedStrUrl]]] ; - (id <SDMRequesting>)executeBasicSyncRequestWithQuery3:(ODataQuery *)aQuery { id<SDMRequesting> request = [self createRequestWithQuery:aQuery]; [request setTimeOutSeconds:TIMEOUT_SEC]; [request setRequestMethod:@"GET"]; [request addRequestHeader:@"Content-Type" value:@"application/xml"]; [request startSynchronous];**[App getting CRASH in this line]** return request; } - (id <SDMRequesting>)createRequestWithQuery:(ODataQuery *)aQuery { if (isSUPMode) { [SDMRequestBuilder setRequestType:SUPRequestType]; } else { [SDMRequestBuilder setRequestType:HTTPRequestType]; } id <SDMRequesting> request = [SDMRequestBuilder requestWithURL:aQuery.URL]; request.username = self.username; request.password = self.password; return request; } Crash Report:- Incident Identifier: 347511BA-5F7F-45D4-8662-D5DCD2F88EA7 CrashReporter Key: 9a4d38cf19b1a94476eb6b2170d4f56678d6ca60 Hardware Model: iPad3,4 Path: /var/mobile/Applications/F38AD64F-03F8-4A21- Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000 Triggered by Thread: 0 Thread 0 Crashed: 0 libsystem_platform.dylib 0x393a94c0 _platform_memmove$VARIANT $Swift + 160 1 Eby Sales Order 0x0015a2c8 0xb7000 + 668360 2 Eby Sales Order 0x0015a8b8 0xb7000 + 669880 3 Eby Sales Order 0x003331ee 0xb7000 + 2605550 4 Eby Sales Order 0x0031856e 0xb7000 + 2495854 5 Eby Sales Order 0x00338454 0xb7000 + 2626644 6 Eby Sales Order 0x000e6ad8 0xb7000 + 195288 7 Eby Sales Order 0x000e99a0 0xb7000 + 207264 8 Eby Sales Order 0x000ea442 0xb7000 + 209986 9 Eby Sales Order 0x000eb0d6 0xb7000 + 213206 10 Eby Sales Order 0x000c13d0 0xb7000 + 41936 11 Foundation 0x2ec93112 __NSFireDelayedPerform + 410 12 CoreFoundation 0x2e27ef4c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12 13 CoreFoundation 0x2e27eb66 __CFRunLoopDoTimer + 790 14 CoreFoundation 0x2e27ceee __CFRunLoopRun + 1214 15 CoreFoundation 0x2e1e7764 CFRunLoopRunSpecific + 520 16 CoreFoundation 0x2e1e7546 CFRunLoopRunInMode + 102 17 GraphicsServices 0x331216ce GSEventRunModal + 134 18 UIKit 0x30b4688c UIApplicationMain + 1132 19 Eby Sales Order 0x000bd8da 0xb7000 + 26842 20 Eby Sales Order 0x000bd89c 0xb7000 + 26780

    Read the article

  • Sending custom app logs to developer

    - by Templar
    I'm planning to release a new app in the future. I have a custom logging function which logs some application data (not crashes) into a file (location manager state, app foreground-background transitions, main actions...). These logs helped me a lot to debug problems which were app-related, but not causing a crash. Until now these were in the documents directory (shared in iTunes) and the testers sent them to me after they saw some incorrect behaviors, however I don't want to share them anymore because this directory contains the app's database too. I'd like to obtain these logs even when the app will be on App Store, but I don't know how this should be done. As I wrote, it is a new app and even after the test phase may exist minor bugs. I know that the users can report problems in iTunes or on the Dev site, but without a detailed scenario or log it is really hard to correct a bug. Should I make some kind of in-app bug report functionality (even if this creates a wrong user impression) ? How is this usually handled ? Thanks

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >