Tag: ipad

How do I detect which iOS device my user is using?

I’m searching for a way to detect the device my app is running on. I am not interested in software version. I searched many questions but none of them (surprisingly) satisfy my needs for following reasons: Solution 1: NSString *deviceType = [UIDevice currentDevice].model; This does not work because it gives me just “iPad”. I want […]

iOS5 data storage issue. Where to save files?

Firstly, I have read these: (1) http://www.gaiagps.com/news/article/iOS5%20Breaks%20Data%20Storage%20and%20Crushes%20My%20Soul (2) http://iphoneincubator.com/blog/data-management/local-file-storage-in-ios-5 (I can not submit more than two hyperlinks because I’m a noob.) and all the related developer forum threads in apple.com. Problem: with the new iOS5, we need to save files to /Caches folder, and save only user generated files to the /Documents folder. And caches […]

How to set the buttons label text color for state UIControlStateHighlighted

I am creating an iPhone application in which i have a custom button. i have set the buttons title by creating a Label and adding it as subview. now when the button is highlighted i want to change the labels text color. here is my code, UIButton *button1= [UIButton buttonWithType:UIButtonTypeCustom]; [button1 setFrame:CGRectMake(68,162, 635, 101)]; [button1 […]

How to check if a UIViewController is of a particular sub-class in objective c?

I want to be able to check the type of a UIViewController to see if it is of a certain type like this c code if (typeof(instance1) == customUIViewController) { customUIViewController test = (customViewController)instance1; // do more stuff }

UIView rotates while scaling using CGAffineTransformMakeScale

Im using CGAffineTransformMakeScale to scale a UIView from 0.1 to 1.0. The problem is that the view is also rotating while the scaling is being animated. So it ends with a scale of 1.0 AND 90ยบ of rotation. [self presentModalViewController:slideTwoViewController animated: NO]; [slideTwoViewController.view setTransform:CGAffineTransformMakeScale(0.1,0.1)]; [UIView beginAnimations: nil context: nil]; [UIView setAnimationDuration:2.0]; [slideTwoViewController.view setTransform:CGAffineTransformMakeScale(1.0,1.0)]; [UIView commitAnimations]; […]

How erase part of UIImage

Is there a way to erase the black background for that image I’ve found this sample code found on this topic but i don’t understand how it works – (void)clipImage { UIImage *img = imgView.image; CGSize s = img.size; UIGraphicsBeginImageContext(s); CGContextRef g = UIGraphicsGetCurrentContext(); CGContextAddPath(g,erasePath); CGContextAddRect(g,CGRectMake(0,0,s.width,s.height)); CGContextEOClip(g); [img drawAtPoint:CGPointZero]; imageView.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } Maybe […]

How to use UIPageControl with iCarousel?

I have some images within icarousel. (about 20 images) I wanna 5 images in a page. There is no problem about image pixel or image location. How to use uipagecontrol WITHOUT ScrollView? ex) able to use some delegate methods.. and so on. carousel.type = iCarouselTypeLinear; carousel = [[iCarousel alloc] initWithFrame:CGRectMake(0, 504, 1024, 164)]; carousel.backgroundColor = […]

iPad app only shows black screen after updating to iOS4 SDK

I just opened an iPad app I’d been working on and it was working fine, until now. I open it and the screen remains black, even after it’s loaded! It’s an OpenGL and I just downloaded the iOS4 SDK. I also added a provisioning profile. Would any of these changes result in a completely black […]

UIView background color affects touches in iOS 5

I had a custom view with subclassed touch responses that was working in iOS 4. On iOS 5, these touches would not respond at all when touched along the bottom edge of the view, if the view’s background color was set to clearColor. I have not been able to track this down, but does anyone […]

handle tap gesture with an argument iphone / ipad

when my tap gesture fires I need to send an additional argument along with it but I must be doing something really silly, what am I doing wrong here: Here is my gesture being created and added: UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:itemSKU:)]; tapGesture.numberOfTapsRequired=1; [imageView setUserInteractionEnabled:YES]; [imageView addGestureRecognizer:tapGesture]; [tapGesture release]; [self.view addSubview:imageView]; Here is […]