Search Results

Search found 15682 results on 628 pages for 'iphone'.

Page 175/628 | < Previous Page | 171 172 173 174 175 176 177 178 179 180 181 182  | Next Page >

  • iPhone: Execute code after animation of UIDeviceOrientation change finishes

    - by carloe
    Not sure if I can explain this correctly, but I am trying to execute a method device orientation animation finishes. Right now I have [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil];, but that triggers instantly. Is there a way to have it call didRotate after the view rotation animation is completed? Thanks!

    Read the article

  • iphone Three20 TTNavigator UITabbarController

    - by Ward
    Not sure if what I want to do makes sense, but I want to take advantage of the UITabBarController and the TTNavigator from Three20. Any tutorials around that demonstrate how this can be done? I understand how to add view controllers to the navigator using the TTURLMap, but do I need to add a navigator for each tabbar item? I'm lost.

    Read the article

  • 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

  • iPhone Provisioning Profile problems...

    - by James
    I have already successfully submitted two apps to the app store, so I should be able to do it by now, right? With my most recent app, however, I'm having a bear of a time with getting the Application Identifier or Bundle Identifier set up. In my distribution profile, I have included the identifier "com.jmock.irowbeta", and then copied it exactly into the the app's Info.plist file under "Bundle Identifier". In the past, this has done the trick, but now I'm getting the error Provisioning profile 'irow beta' specificies the identifier 'com.jmock.irowbeta' which doesn't match the current setting 'com.yourcompany.irow-beta'. So it seems that its somehow still using the default of com.yourcompany.APPLICATION_NAME, but it shouldn't after I have changed it in the Info.plist, right? I think this means that xcode isn't recognizing that PLIST for some reason, because when I change the name of the icon file, for example, or other such attributes, nothing changes. If this is the problem, how do I make xcode recognize the PLIST? Otherwise, what the heck is going on? Thanks, James

    Read the article

  • Difficulties signing in to Twitter from iPhone

    - by Tristan
    Hi there, I'm using MGTwitterEngine to add Twitter functionality to my app. It's very easy to simply prompt the user for a username and password and then start posting. Strangely, however, I've noticed other apps (eg Foursquare and Brightkite) require you to visit their website to associate your Twitter account with your foursquare/brightkite/whatever account. Why do they do it this way? Is there a reason why my app shouldn't prompt the user for a Twitter username and password, even though it would be so easy? Thanks a bunch! Tristan

    Read the article

  • iPhone - Setting background on UITableView

    - by Hans Espen
    Is there any way to set a background view on a UITableViewController? I try with the code I am using on a UIViewController, but the view comes over all the contents of the table view, and if I add the background view in the cellForRowAtIndexPath-method, it is not showing at all. Anyone done this before or have an idea on how it can be done? Here is the code I am using: UIImage *image = [UIImage imageNamed: @"background.jpg"]; UIImageView *backImage = [[UIImageView alloc] initWithImage: image]; [self.view addSubview: backImage]; [self.view sendSubviewToBack: backImage]; Thanks

    Read the article

  • iPhone Simulator chrashes in NSKeyedUnarchiver after setting base SDK

    - by Florian
    Hi! I started a project in xcode (3.2 on snow leopard) with base sdk 3.1.2. Now I changed this setting to 3.0 and it compiles without a warning. There are no problems running the app on the device, but the simulator crashes on launch every time with the following exception: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x4e, 0x49, 0x42, 0x41, 0x72, 0x63, 0x68, 0x69)' I do not use the NSKeyedUnarchiver, so why is the app trying to call it? And what archive is incomprehensible? I reset the simulator before building, so there are no userDefaults or anything else around. Thanks for your help!

    Read the article

  • iPhone app running in Instruments fails with unrecognized selector

    - by Mark Smith
    I have an app that appears to run without problems in normal use. The Clang Static Analyzer reports no problems either. When I try to run it in Instruments, it fails with an unrecognized selector exception. The offending line is a simple property setter of the form: self.bar = baz; To figure out what's going on, I added an NSLog() call immediately above it: NSLog(@"class = %@ responds = %d", [self class], [self respondsToSelector:@selector(setBar:)]); self.bar = baz; On the emulator (without Instruments) and on a device, this shows exactly what I'd expect: class = Foo responds = 1 When running under Instruments, I get: class = Foo responds = 0 I'm stumped as to what could cause this. Perhaps a different memory location is getting tromped on when it's in the Instruments environment? Can anyone suggest how I might debug this?

    Read the article

  • iPhone app memory leak

    - by Marian Busoi
    Any idea why this code gives me a memory leak? As you can see, I'm running out of ideas as to what I can do to stop it. (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSArray *allSketches = [project.sketches allObjects]; NSMutableArray *temp = [[NSMutableArray alloc] initWithArray:allSketches]; if(sketchesArray != nil) [sketchesArray release]; [self setSketchesArray:temp]; [allSketches release]; allSketches = nil; [temp release]; temp = nil; } I also release sketchesArray inside viewDidDissapear. I'm not using viewDidLoad and dealloc to init/release these objects as what I am doing requires me to use viewWillAppear and viewDidDissapear. Thanks

    Read the article

  • iPhone - Merge keys in a NSArray (Objective-C)

    - by ncohen
    Hi everyone, I'm having troubles with arrays and keys... I have an array from my database: NSArray *elementArray = [[[menuArray valueForKey:@"meals"] valueForKey:@"recipe"] valueForKey:@"elements"] The problem here is that I would like all my elements of all my meals of all my menus in an array such that: [elementArray objectAtIndex:0] = my first element etc... In the example above, the elements are separated by the keys. How can I get that? Hope it's clear enough... Thanks

    Read the article

  • NSNumberFormatter crashing iPhone SDK 4.0b2

    - by Ward
    Hey there, I've got an app that's been in the app store for a while and functions perfectly on OS 3.1 - 3.13. However, when tested on 4.0b2 I noticed that it crashes in the same place every time, but only on the device, never on the simulator. I'm using a 3GS to test. On loadView I initialize an NSNumberFormatter object which is declared and retained in the interface so I have access to it everywhere. In my method I call it several times to convert string values into nsnumbers to be stored in a mutable dictionary. Here's an example: [myDictionary setObject:[myStyleFormatter numberFromString:@"1"] forKey:@"hours"]; [myDictionary setObject:[myStyleFormatter numberFromString:@"30"] forKey:@"minutes"]; [myDictionary setObject:[myStyleFormatter numberFromString:@"10"] forKey:@"seconds"]; For some reason it crashes as soon as it tries to set hours. The error is "attempt to insert nil value (key: hours)" Have I been doing something wrong all along? Has the api changed for 4.0b2? Thanks, Howie

    Read the article

  • Retain count problem iphone sdk

    - by neha
    Hi all, I'm facing a memory leak problem which is like this: I'm allocating an object of class A in class B. // RETAIN COUNT OF CLASS A OBJECT BECOMES 1 I'm placing the object in an nsmutablearray. // RETAIN COUNT OF CLASS A OBJECT BECOMES 2 In an another class C, I'm grabbing this nsmutablearray, fetching all the elements in that array in a local nsmutablearray, releasing this first array of class B. // RETAIN COUNT OF CLASS A OBJECTS IN LOCAL ARRAY BECOMES 1 Now in this class C, I'm creating an object of class A and fetching the elements in local nsmutable array. //RETAIN COUNT OF NEW CLASS A OBJECT IN LOCAL ARRAY BECOMES 2 [ALLOCATION + FETCHED OBJECT WITH RETAIN COUNT 1] My question is, I want to retain this array which I'm displaying in tableview, and want to release it after new elements are filled in the array. I'm doing this in class B. So before adding new elements, I'm removing all the elements and releasing this array in class B. And in class C I'm releasing object of class A in dealloc. But in Instruments-Leaks it's showing me leak for this class A object in class C. Can anybody please tell me wheather where I'm going wrong. Thanx in advance.

    Read the article

  • Adding UIViews with dynamic heights iphone

    - by Andy Jacobs
    in my viewcontroller's view i need to add a couple of custom UIView's, i do that in the loadView method so in my custom uiview's drawRect method i add a couple of UILabel's. in my viewcontroller's view i need to add all those custom UIView's underneath each other but i don't know what their height is sometimes 20px, 40px, 60px, depending on the outcome of the drawRect so when i init my custom UIView i give it a frame height of lets say 50.. but when the drawRect is done and it's only 20, 50 is too much so i need to adjust the frame height but how can i determine what's the visible height of the custom UIView and where can i catch it in my viewcontroller when the custom uiview has finished his drawRect method is there some kind of autoresize and where do i catch it in my viewcontroller, so i can position the custom uiview right under neath each other.

    Read the article

  • How to crop Image in iPhone?

    - by aman-gupta
    Hi, In my application I m using following codes to crop the captured image :- -(void)imagePickerController:(UIImagePickerController *) picker didFinishPickingMediaWithInfo:(NSDictionary *)info { #ifdef _DEBUG NSLog(@"frmSkinImage-imagePickerController-Start"); #endif imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; //======================================= UIImage *image =imageView.image; CGRect cropRect = CGRectMake(100, 100, 125,128); CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropRect); [imageView setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef); //=================================================== //imgglobal = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; // for saving image to photo album //UIImageWriteToSavedPhotosAlbum(imageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), self); [picker dismissModalViewControllerAnimated:YES]; #ifdef _DEBUG NSLog(@"frmSkinImage-imagePickerController-End"); #endif } But my problem is that when I use camera to take photo to crop the captured image it rotates the image to 90 degree towards right and in case I use Photo library it works perfectly. So Can u filter my above codes to know where I m wrong. Please help me out its urgent Thanks In Advance

    Read the article

  • Locate RFID tag using iPhone

    - by Dan
    Hi all, I am looking into building an app (on my laptop to start) that would be able to locate the signal emitted by an RFID tag (non passive). Say I attach this to my key ring, what would be required of the application to triangulate the location of the RFID tag in a 10m range. Would this even be possible using this technology? I see some older posts here so wondering if there have been any tech breakthroughs in this area since then? Dan

    Read the article

  • Simultaneous gesture recognizers in Iphone SDK

    - by minaevs
    I need to catch two different swipping gestures using UISwipeGestureRecognizer(for example, UISwipeGestureRecognizerDirectionRight and UISwipeGestureRecognizerDirectionLeft). When I add two different recognisers with addGestureRecognizer method, only last added recognizer works. I've read that I need to implement gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: method of UIGestureRecognizerDelegate protocol, but nothing works. Can anyone help with simple example of catching two or more same gestures? Thanks!

    Read the article

  • iphone cannot rotate views in TabBar controller

    - by Luc
    Hello, I am working on an application that consists of a TabBar controller. Within on of its tab, I have a subclass of UITableViewController, within this list I have a Core-plot graph in the first cell and some other data in the 4 following cells. When I return YES in the shouldAutorotateToInterfaceOrientation method, I would expect the autoresizing of the list view to happen, but... nothing. When I add some log in the willRotateToInterfaceOrientation method, they are not displayed. Is there something I missed ? Thanks a lot, Luc // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations //return (interfaceOrientation == UIInterfaceOrientationPortrait); NSLog(@"Orientation"); return YES; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; NSLog(@"Rotating"); if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) { NSLog(@"view land:%@", self.view); } if (toInterfaceOrientation == UIInterfaceOrientationPortrait) { NSLog(@"view portrait:%@", self.view); } }

    Read the article

  • iPhone smooth move and pinch of UIImageView

    - by Jacob
    I have an image view that I'm wanting to be able to move around, and pinch to stretch it. It's all working, but it's kinda jumpy when I start to do any pinch movements. The position will jump back and forth between the two fingers. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { startLocation = [[touches anyObject] locationInView:mouth_handle]; if([touches count] == 2) { NSArray *twoTouches = [touches allObjects]; UITouch *first = [twoTouches objectAtIndex:0]; UITouch *second = [twoTouches objectAtIndex:1]; initialDistance = distanceBetweenPoints([first locationInView:mouth_handle],[second locationInView:mouth_handle]); } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint pt = [[touches anyObject] locationInView:mouth_handle]; CGRect frame = [mouth_handle frame]; frame.origin.x += pt.x - startLocation.x; frame.origin.y += pt.y - startLocation.y; frame.origin.x = (frame.origin.x < 58) ? 58 : frame.origin.x; frame.origin.x = (frame.origin.x > (260 - mouth_handle.frame.size.width)) ? (260 - mouth_handle.frame.size.width) : frame.origin.x; frame.origin.y = (frame.origin.y < 300) ? 300 : frame.origin.y; frame.origin.y = (frame.origin.y > 377) ? 377 : frame.origin.y; if(frame.origin.x - prevDistanceX > 2 && frame.origin.x - prevDistanceX < -2) frame.origin.x = prevDistanceX; if(frame.origin.y - prevDistanceY > 2 && frame.origin.y - prevDistanceY < -2) frame.origin.y = prevDistanceY; prevDistanceX = frame.origin.x; prevDistanceY = frame.origin.y; CGFloat handleWidth = mouth_handle.frame.size.width; if([touches count] == 2) { NSArray *twoTouches = [touches allObjects]; UITouch *first = [twoTouches objectAtIndex:0]; UITouch *second = [twoTouches objectAtIndex:1]; CGFloat currentDistance = distanceBetweenPoints([first locationInView:mouth_handle],[second locationInView:mouth_handle]); handleWidth = mouth_handle.frame.size.width + (currentDistance - initialDistance); handleWidth = (handleWidth < 60) ? 60 : handleWidth; handleWidth = (handleWidth > 150) ? 150 : handleWidth; if(initialDistance == 0) { initialDistance = currentDistance; } initialDistance = currentDistance; } mouth_handle.frame = CGRectMake(frame.origin.x, frame.origin.y, handleWidth, 15); } Any thoughts on how to make this smoother?

    Read the article

  • How to switch versions of iPhone SDK?

    - by mobibob
    Now that I installed SDK 3.2 for my iPad development, I need to build with the previous version for my old iTouch. Is this possible to switch or do I have to uninstall 3.2, install 3.1.x and re-install 3.2 in a "versioned" folder?

    Read the article

  • stack and heap issue for iPhone memory management

    - by Forrest
    From this post I got know that the Objective-C runtime does not allow objects to be instantiated on the stack, but only on the heap; this means that you don’t have “automatic objects”, nor things like auto_ptr objects to help you manage memory; Someone give one example in post Objective C: Memory Allocation on stack vs. heap NSString* str = @"hello"; but this NSString is also not allocated in stack. Feel odd that this str is static. (Who can explain this ? ) Question here is that why there is no heap ? even mixing c++ together with Object C ? /////////////////////////////// Clear my question /////////////////////////////// I am confused , so questions are not clear. Let me put in this way. 1) All Object C objects should be alloc in stack ? ( I think yes ) 2)In C++, there are stack for memory, so for iOS app, also have stack ? ( I think yes ) 3) for iOS app, if only use Object C, so what is the usage of stack ? what kind of objects should use stack then ?

    Read the article

  • javascript scroll event for iPhone/iPad ?

    - by _ck_
    I can't seem to capture the scroll event on an iPad. None of these work, what I am doing wrong? window.onscroll=myFunction; document.onscroll=myFunction; window.attachEvent("scroll",myFunction,false); document.attachEvent("scroll",myFunction,false); They all work even on Safari 3 on Windows. Ironically, EVERY browser on the PC supports window.onload= if you don't mind clobbering existing events. But no go on iPad.

    Read the article

  • iPhone -- MKReverseGeocoder.adminstrativeArea -- getting state abbreviation

    - by rayjohannessen
    In the documentation for MKReverseGeocoder, the administrativeArea property gives you the current state the user is in, and it mentions in an example that it returns EITHER the state name OR its abbreviation. I am wondering if anyone knows how to get the abbreviation instead of the full state name...I have been able to find nothing that shows this is even a possibility besides that brief example that doesn't mention HOW. Thanks!

    Read the article

  • iPhone UIView frame animation inconsistent why?

    - by Rick
    I have an app that uses an image loaded in from an UIImagePickerController instance. Once the picker is dismissed so as to reduce the jarring transition from the picker layout to the layout of the next function I initially have the UIImageView for the image fill the whole screen and then when the picker is dismissed the image 'squeezes' up to the top left of the screen. from the initWithFrame... targetPicView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)]; [targetPicView setContentMode:UIViewContentModeScaleToFill]; this in a function called after dismissing the picker... [UIView beginAnimations:@"squeeze" context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.75]; [targetPicView setFrame:CGRectMake(20.0, 20.0, 130.0, 150.0)]; [UIView commitAnimations]; The weird thing is that this works great when the image has been chosen from the library, the view shrinks down with the top left corner in place just as I planned but... If the image comes from the camera then the view shrinks with the top right corner in place instead and appears to come in from the left side of the screen. Can anyone shed any light on this?

    Read the article

  • Setting ivar in objective-c from child view in the iPhone

    - by Ivan
    Hi there! Maybe a FAQ at this website. I have a TableViewController that holds a form. In that form I have two fields (each in it's own cell): one to select who paid (single selection), and another to select people expense is paid for (multiple selection). Both fields open a new TableViewController included in an UINavigationController. Single select field (Paid By) holds an object Membership Multiple select field (Paid For) holds an object NSMutableArray Both vars are being sent to the new controller identically the same way: mySingleSelectController.crSelectedMember = self.crPaidByMember; myMultipleSelectController.crSelectedMembers = self.crSelectedMembers; From Paid for controller I use didSelectAtIndexPath method to set a mutable array of Memberships for whom is paid: if ([[tableView cellForRowAtIndexPath:indexPath] accessoryType] == UITableViewCellAccessoryCheckmark) { [self.crSelectedMembers removeObject:[self.crGroupMembers objectAtIndex:indexPath.row]]; //... } else { [self.crSelectedMembers addObject:[self.crGroupMembers objectAtIndex:indexPath.row]]; //... } So far everything goes well. An mutable array (crSelectedMembers) is perfectly set from child view. But... I have trouble setting Membership object. From Paid By controller I use didSelectAtIndexPath to set Membership: [self setCrSelectedMember:[crGroupMembers objectAtIndex:indexPath.row]]; By NSlogging crSelectedMember I get the right selected member in self, but in parent view, to which ivar is pointed, nothing is changed. Am I doing something wrong? Cause I CAN call the method of crSelectedMembers, but I can't change the value of crSelectedMember.

    Read the article

< Previous Page | 171 172 173 174 175 176 177 178 179 180 181 182  | Next Page >