Search Results

Search found 7409 results on 297 pages for 'corona sdk'.

Page 15/297 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • IPhone SDK Default NSUserDefaults...

    - by Harry
    I have set up the user defaults to record a integer for a UISlider, the problem is that, if the user has only just installed the app then the integer is zero or NULL. Is there a way to detect if it = NULL with a integer? heres my code i have so far: -(void)awakeFromNib { NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; senset = [prefs integerForKey:@"senset"]; senset = sensitivity.value; } - (IBAction) setSens { senset = sensitivity.value; } - (IBAction) goBackopt { { NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs setInteger:senset forKey:@"senset"]; [prefs synchronize]; } } senset is the integer. i have tried this code, and it sets it to 25 on the first time, but then if i try and overwrite it, it wont work and keeps setting it to 25. :( if ( [prefs integerForKey:@"senset"] == NULL ) { senset = 25; } Please help :P Harry

    Read the article

  • Playing sounds in iPhone SDK?

    - by seanny94
    Does anyone have a snippet that uses the AudioToolBox framework that can be used to play a short sound? I would be grateful if you shared it with me and the rest of the community. Everywhere else I have looked doesn't seem to be too clear with their code. Thanks!

    Read the article

  • How to change UIBarButtonItem Title - iPhone SDK

    - by user340226
    Hi Can anyone help me in that I am only trying to change the Title on an UIBarButtonItem from a different class. My code is: -(IBAction)spanishPush { SafetyTalks *bbiTitle= [[SafetyTalks alloc]init]; bbiTitle.bbiOpenPopOver.title = @"Spanish"; } SafetyTalks = the class I am trying to reference bbiOpenPopOver = the UIBarButtonItem. I can change the Title when in the SafetyTalks class by simple: bbiOpenPopOver.title = @"Talk Topics"; but cannot do it when I am out of that class. Please help. Andy

    Read the article

  • Custom view in iPhone SDK gets placed incorrectly in realation to statusbar

    - by markqvist
    (ragh, i'm apparently not allowed to post images, so i have included links to the images in this post instead of embedding them) Im writing an iPhone application based on the navigation controller template, but I am not loading the actual navigation controller as the first view in the window. I create a new view controller from a xib, and then add that as a subview, and then only push the navigation view as a modal when i need it. Here's my application: didFinishLaunching ... method in the application deleate RootViewController *rootViewController = (RootViewController *)[navigationController topViewController]; rootViewController.managedObjectContext = self.managedObjectContext; mainViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:[NSBundle mainBundle]]; mainViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [window addSubview:[mainViewController view]]; [[mainViewController view] setNeedsLayout]; [window makeKeyAndVisible]; return YES; It works but the view is not properly aligned with the statusbar: http://img.exdev.dk/1.png When i click "my ambiances" and push the navigation controller view, and then dismiss it again, the layout is fine: same link as above, just replace the 1 with a 2. Sorry for the hassle, apparently I can also only post one link.... Here's the code I use for presenting/dismissing the navigationcontroller: -(void)pushMyAmbiences { [mainViewController presentModalViewController:navigationController animated:TRUE]; } -(void)returnToMainView { [mainViewController dismissModalViewControllerAnimated:TRUE]; } Is there anything I'm missing here? Layout-wise? Something that needs to be set in the xib? In a vain attempt I tried calling setNeedsLayout on the view, no luck. Any help is greatly appreciated!

    Read the article

  • A simple way to implement pathfinding using bullet physics - iPhone SDK

    - by Dave
    Hi, I have bullet physics set up and working on the iPhone but now I want to implement some sort of path finding with it. The problem is I have no idea where to start, the level is pretty simple just a lot of pillars that I want the 'bad guys' to navigate around to get to the player character. Do you have any suggestions or are there any tutorials you recommend for pathfinding using this on the iPhone?

    Read the article

  • Taking video from video camera and displaying it with MPMoviePlayerController IPhone SDK

    - by Daniel
    Has anyone tried taking a video from the camera and then using the video player provided to play it? When you take the video in portrait mode, sometimes the movie will play (when the player puts it in landscape mode) and when it puts it in portrait mode you cannot view the movie all you hear is sound,sometimes in landscape mode is flickers and does not play right, has anyone encountered this and found a way to fix it? My code to play the video looks like this: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSURL *urls=[info objectForKey:@"UIImagePickerControllerMediaURL"] ; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[info urls]]; if (moviePlayer) { [moviePlayer play]; } } I checked settings on the docs nothing seems like it would fix this...Thanks

    Read the article

  • iPhone SDK / Objective C Syntax Question

    - by Koppo
    To all, I was looking at the sample project from http://iphoneonrails.com/ and I saw they took the NSObject class and added methods to it for the SOAP calls. Their sample project can be downloaded from here http://iphoneonrails.com/downloads/objective_resource-1.01.zip. My question is related to my lack of knowledge on the following syntax as I haven't seen it yet in a iPhone project. There is a header file called NSObject+ObjectiveResource.h where they declare and change NSObject to have extra methods for this project. Is the "+ObjectiveResource.h" in the name there a special syntax or is that just the naming convention of the developers. Finally inside the class NSObject we have the following #import <Foundation/Foundation.h> @interface NSObject (ObjectiveResource) // Response Formats typedef enum { XmlResponse = 0, JSONResponse, } ORSResponseFormat; // Resource configuration + (NSString *)getRemoteSite; + (void)setRemoteSite:(NSString*)siteURL; + (NSString *)getRemoteUser; + (void)setRemoteUser:(NSString *)user; + (NSString *)getRemotePassword; + (void)setRemotePassword:(NSString *)password; + (SEL)getRemoteParseDataMethod; + (void)setRemoteParseDataMethod:(SEL)parseMethod; + (SEL) getRemoteSerializeMethod; + (void) setRemoteSerializeMethod:(SEL)serializeMethod; + (NSString *)getRemoteProtocolExtension; + (void)setRemoteProtocolExtension:(NSString *)protocolExtension; + (void)setRemoteResponseType:(ORSResponseFormat) format; + (ORSResponseFormat)getRemoteResponseType; // Finders + (NSArray *)findAllRemote; + (NSArray *)findAllRemoteWithResponse:(NSError **)aError; + (id)findRemote:(NSString *)elementId; + (id)findRemote:(NSString *)elementId withResponse:(NSError **)aError; // URL construction accessors + (NSString *)getRemoteElementName; + (NSString *)getRemoteCollectionName; + (NSString *)getRemoteElementPath:(NSString *)elementId; + (NSString *)getRemoteCollectionPath; + (NSString *)getRemoteCollectionPathWithParameters:(NSDictionary *)parameters; + (NSString *)populateRemotePath:(NSString *)path withParameters:(NSDictionary *)parameters; // Instance-specific methods - (id)getRemoteId; - (void)setRemoteId:(id)orsId; - (NSString *)getRemoteClassIdName; - (BOOL)createRemote; - (BOOL)createRemoteWithResponse:(NSError **)aError; - (BOOL)createRemoteWithParameters:(NSDictionary *)parameters; - (BOOL)createRemoteWithParameters:(NSDictionary *)parameters andResponse:(NSError **)aError; - (BOOL)destroyRemote; - (BOOL)destroyRemoteWithResponse:(NSError **)aError; - (BOOL)updateRemote; - (BOOL)updateRemoteWithResponse:(NSError **)aError; - (BOOL)saveRemote; - (BOOL)saveRemoteWithResponse:(NSError **)aError; - (BOOL)createRemoteAtPath:(NSString *)path withResponse:(NSError **)aError; - (BOOL)updateRemoteAtPath:(NSString *)path withResponse:(NSError **)aError; - (BOOL)destroyRemoteAtPath:(NSString *)path withResponse:(NSError **)aError; // Instance helpers for getting at commonly used class-level values - (NSString *)getRemoteCollectionPath; - (NSString *)convertToRemoteExpectedType; //Equality test for remote enabled objects based on class name and remote id - (BOOL)isEqualToRemote:(id)anObject; - (NSUInteger)hashForRemote; @end What is the "ObjectiveResource" in the () mean for NSObject? What is that telling Xcode and the compiler about what is happening..? After that things look normal to me as they have various static and instance methods. I know that by doing this all user classes that inherit from NSObject now have all the extra methods for this project. My question is what is the parenthesis are doing after the NSObject. Is that referencing a header file, or is that letting the compiler know that this class is being over ridden. Thanks again and my apologies ahead of time if this is a dumb question but just trying to learn what I lack.

    Read the article

  • iPhone sdk, at dismissModalViewcontrollerAnimated, the parent change y origin coordinate

    - by DigitalVanilla
    Hi guys, my first post here :) I'm having a small trouble with a small but boring problem. I have a view, with a NavigationController. I load in the NC a simple view. Inside this view there's abutton where I fire the presentModalView... in the main view, not on NC, but it's parent view: ABVIEW NC NEWVIEW new attach a presentModalView... on ABVIEW, so [abview present...]; No problem till now. When it's the time to dismiss, after the temporary window (let's calls it NOTES) disappear, my ABVIEW with all the subviews change Y position from 0 to 20, the same height of the status bar. I was looking everywhere and I'm sure it's a stupid thing, but I miss a bit of knowledge here and I have no idea where to find the solution. thanks in advance!

    Read the article

  • iPhone SDK Push notification randomly fails

    - by Jameson
    I have a PHP file with the following content that works perfectly on development ceritficates, but when I switch to a production certificate the PHP errors and gives the below message, but it only does this about 50% of the time. The other 50% it works. Anyone know why this might be happening? <?php // masked for security reason $deviceToken = 'xxxxxx'; // jq $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', dirname(__FILE__)."/prod.pem"); $number = 5; $fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx); if (!$fp) { print "Failed to connect $err $errstr\n"; } else { print "Connection OK\n"; $msg = $_GET['msg']; $payload['aps'] = array('alert' => $msg, 'badge' => 1, 'sound' => 'default'); $payload = json_encode($payload); $msg = chr(0) . pack("n",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n",strlen($payload)) . $payload; print "sending message :" . $payload . "\n"; fwrite($fp, $msg); fclose($fp); } ?> The PHP error: Warning: stream_socket_client() [function.stream-socket-client]: Unable to set local cert chain file `/var/www/vhosts/thissite.com/httpdocs/prod.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /var/www/vhosts/thissite.com/httpdocs/pushMessageLive.php on line 19 Failed to connect 0

    Read the article

  • URLCache - iPhone SDK

    - by Kevin
    Hello everyone.. I need some help in using the NSURLCache to download a simple file. It would need to be saved in the Documents folder of the app. I have seen the URLCache example that apple presented, but I didn't find it useful since it was an image that was being shown. In addition there was some complex code on the modification date. I actually need something when the application opens it will begin the download process. Can someone guide me through just the download process of any file? Thanks Kevin

    Read the article

  • iPhone SDK background thread image loading problem

    - by retailevolved
    I have created a grid view that displays six "cells" of content. In each cell, an image is loaded from the web. There are a multiple pages of this grid (the user moves through them by swiping up / down to see the next set of cells). Each cell has its own view controller. When these view controllers load, they use an ImageLoader class that I made to load and display an image. These view controllers implement an ImageLoaderDelegate that has a single method that gets called when the image is finished loading. ImageLoader does its work on a background thread and then simply notifies its delegate when it is done loading, passing the image to the delegate method. Trouble is that if the user moves on to the next page of grid content before the image has finished loading (releasing the GridCellViewControllers that use the ImageLoaders), the app crashes. I suspect that this is because along the line, an asynchronous method finishes and attempts to notify its delegate but can't because it's been released. Here's some code to give a better picture: GridCellViewController.m: - (void)viewDidLoad { [super viewDidLoad]; // ImageLoader _loader = [[ProductImageLoader alloc] init]; _loader.delegate = self; if(_boundObject) [_loader loadImageForProduct:_boundObject]; } //ImageLoaderDelegate method - (void) imageDidFinishLoading: (UIImage *)image { [_imgController setImage:image]; } ProductImageLoader.m - (void) loadImageForProduct: (Product *) product { // Get image on another thread [NSThread detachNewThreadSelector:@selector(getImageForProductInBackground:) toTarget:self withObject:product]; } - (void) getImageForProductInBackground: (Product *) product { NSAutoreleasePool *tempPool = [[NSAutoreleasePool alloc] init]; HttpRequestLoader *tempLoader = [[HttpRequestLoader alloc] init]; NSURL *tempUrl = [product getImageUrl]; NSData *imageData = tempUrl ? [tempLoader loadSynchronousDataFromAddress:[tempUrl absoluteString]] : nil; UIImage *image = [[UIImage alloc] initWithData:imageData]; [tempPool release]; if(delegate) [delegate imageDidFinishLoading:image]; } The app crashes with EXC_BAD_ACCESS. Disclaimer: The code has been slightly modified to focus on the issue at hand.

    Read the article

  • Memory leak problem. iPhone SDK

    - by user326375
    Hello, i've got a problem, i cannot solve it, just recieving error: Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS).The Debugger has exited due to signal 10 (SIGBUS). Here is some method, if i comment it out, problem goes aways - (void)loadTexture { const int num_tex = 10; glGenTextures(num_tex, &textures[0]); //TEXTURE #1 textureImage[0] = [UIImage imageNamed:@"wonder.jpg"].CGImage; //TEXTURE #2 textureImage[1] = [UIImage imageNamed:@"wonder.jpg"].CGImage; //TEXTURE #3 textureImage[2] = [UIImage imageNamed:@"wall_eyes.jpg"].CGImage; //TEXTURE #4 textureImage[3] = [UIImage imageNamed:@"wall.jpg"].CGImage; //TEXTURE #5 textureImage[4] = [UIImage imageNamed:@"books.jpg"].CGImage; //TEXTURE #6 textureImage[5] = [UIImage imageNamed:@"bush.jpg"].CGImage; //TEXTURE #7 textureImage[6] = [UIImage imageNamed:@"mushroom.jpg"].CGImage; //TEXTURE #8 textureImage[7] = [UIImage imageNamed:@"roots.jpg"].CGImage; //TEXTURE #9 textureImage[8] = [UIImage imageNamed:@"roots.jpg"].CGImage; //TEXTURE #10 textureImage[9] = [UIImage imageNamed:@"clean.jpg"].CGImage; for(int i=0; i<num_tex; i++) { NSInteger texWidth = CGImageGetWidth(textureImage[i]); NSInteger texHeight = CGImageGetHeight(textureImage[i]); GLubyte *textureData = (GLubyte *)malloc(texWidth * texHeight * 4); CGContextRef textureContext = CGBitmapContextCreate(textureData, texWidth, texHeight, 8, texWidth * 4, CGImageGetColorSpace(textureImage[i]), kCGImageAlphaPremultipliedLast); CGContextDrawImage(textureContext, CGRectMake(0.0, 0.0, (float)texWidth, (float)texHeight), textureImage[i]); CGContextRelease(textureContext); glBindTexture(GL_TEXTURE_2D, textures[i]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth, texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); free(textureData); } } anyone can help me with releasing/deleting objects in this method? Thanks.

    Read the article

  • iPad SDK, how to handle orientation with an UIImageView

    - by Salah
    Hello I'm developing an app for iPad and I try to handle multiple orientation. My app contains a webview and a loading UIImageView that appears when my webview is loading content. This UIImageView has a background image that I set in InterfaceBuilder. When I change orientation to landscape, the image is cut. I'd like the UIImageView to set image-portrait.png when the ipad is in portrait mode and image-landscape.png when it's in landscape mode. Thank you for your help and advices! Screenshots :

    Read the article

  • Detect same image names {iPhone SDK}

    - by Momeks
    hi , i want create image animation , i have 50 images with png format now i want set images name ... something like this but doesnt work ! my images name are : iamge_0000 to image_0050 NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"image_%d.png"], //image named doesnt work ??!?!?!?

    Read the article

  • iPhone SDK simple alert message question

    - by Paul
    char asd='a'; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Are you sure?" message:asd delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; [alert show]; [alert release]; above code not compiling in iPhone simulator. Why is that? :)

    Read the article

  • Preset value of HTML Forms - iPhone SDK

    - by laura
    Hi. I'm trying to preset the value of a dropdown menu and the value of a text box in an HTML form. As soon as the user taps the button in my iPhone app, it enters the webview and I was hoping to preset one of the dropdown menus and text field. How do I go about this? I want to set the dropdown to value "4" and the text field to "Giro Apps" Here's the relevant HTML form code: <select id="advSrcId" class="list" onchange="showOther($('advSrcId').options[$('advSrcId').selectedIndex].value)" name="advSrcId"> <option selected="" value="">Select</option> <option value="1">Google</option> <option value="2">Facebook</option> <option value="3">Friend Referral</option> <option value="4">Other</option> </select> <div id="otherAdvsrc" style=""> <p> Please give details here: <br/> <input class="text" type="text" value="" name="advsrc"/> <br/> </p> </div> TIA!

    Read the article

  • iphone sdk - problem pasting into current text location

    - by norskben
    Hi guys I'm trying to paste text right into where the cursor currently is. I have been trying to do what it says at: - http://dev.ragfield.com/2009/09/insert-text-at-current-cursor-location.html The main deal is that I can't just go textbox1.text (etc) because the textfield is in the middle of a custom cell. I want to just have some text added to where the cursor is (when I press a custom key on a keyboard). -I just want to paste a decimal into the textbox... The error I get is: 2010-05-15 22:37:20.797 PageControl[37962:207] * -[MyDetailController paste:]: unrecognized selector sent to instance 0x1973d10 2010-05-15 22:37:20.797 PageControl[37962:207] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[MyDetailController paste:]: unrecognized selector sent to instance 0x1973d10' Note: I have access to the textfield tag (if that helps?) I'm a little past the beginner stage in objective-c, but still not great. My code is currently below, and at https://gist.github.com/d634329e5ddf52945989 Thanks all. MyDetailController.h @interface MyDetailController : UITableViewController <UITextFieldDelegate,UINavigationControllerDelegate> { //...(lots in here) } @end @interface UIResponder(UIResponderInsertTextAdditions) - (void) insertText: (NSString*) text; @end MyDetailController.m @implementation MyDetailController //.... (lots in here) - (void)addDecimal:(NSNotification *)notification { // Apend the Decimal to the TextField. //savedAmount.text = [savedAmount.text stringByAppendingString:@"."]; NSLog(@"Decimal Pressed"); NSLog(@"tagClicked: %d",tagClicked); switch (tagClicked) { case 7: //savedAmount.text = [savedAmount.text stringByAppendingString:@"."]; break; case 8: //goalAmount.text = [goalAmount.text stringByAppendingString:@"."]; break; case 9: //incrementAmount.text = [incrementAmount.text stringByAppendingString:@"."]; break; case 10: //incrementAmount.text = [incrementAmount.text stringByAppendingString:@"."]; break; } [self insertText:@"."]; } -(void)textFieldDidBeginEditing:(UITextField *)textfield{ //UITextField *theCell = (UITextField *)sender; tagClicked = textfield.tag; NSLog(@"textfield changed. tagClicked: %d",tagClicked); } @end @implementation UIResponder(UIResponderInsertTextAdditions) - (void) insertText: (NSString*) text { // Get a refererence to the system pasteboard because that's // the only one @selector(paste:) will use. UIPasteboard* generalPasteboard = [UIPasteboard generalPasteboard]; // Save a copy of the system pasteboard's items // so we can restore them later. NSArray* items = [generalPasteboard.items copy]; // Set the contents of the system pasteboard // to the text we wish to insert. generalPasteboard.string = text; // Tell this responder to paste the contents of the // system pasteboard at the current cursor location. [self paste: self]; // Restore the system pasteboard to its original items. generalPasteboard.items = items; // Free the items array we copied earlier. [items release]; } @end

    Read the article

  • How to add a view on cell.contentview of uitableview iphone sdk

    - by neha
    Hi all, In my application I'm creating a .xib of a class and loading that .xib on cells of uitableview of another class. I want to add this .xib to cell.contentView and not cell. How shall I do that? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString* cellIdentifier = @"testTableCell"; testTableCell * cell = (testTableCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"testTableCell" owner:self options:nil]; cell = tCell; } return cell; } testTableCell is my another class in which I have two labels and two buttons, of which I have created a .xib and loading it to tableview's cell as above. tCell is an object of class testTableCell. Thanks in advance.

    Read the article

  • XML Parsing need help iphone sdk

    - by neha
    Hi all, How do you get "MayurS123" from following xml tag by parsing? <eletitle lnk="http://192.168.10.2/justmeans/trunk/newsfeed/mayurs">MayurS123 Sharma</eletitle> My file is getting parsed properly. Here I'm able to retrieve the lnk component by doing: if([elementName isEqualToString:@"eletitle"]) { aGoodwork.lnk = [attributeDict objectForKey:@"lnk"]; } But I'm not getting how to get in actual title. Thanx in advance.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >