cocoa-touch

How to do antialiasing on a rotated view?

when a UIView is rotated, it's borders look incredible ugly. There's no antialiasing happening at all. Also if it's a UIImageView, no antialiasing happens when rotating the transform matrix. Is there a way to achieve smooth edges and smooth rotation of images? ...

NSXMLParser Question

I am trying to figure out NSXMLParser for my iPhone app and while I generally understand how it works, I am still a little confused about how to extract the values I need. The XML result that I am parsing is very basic. it is like so: <start> <status>300</status> <record> <title>The Title</title> <content>Some content</content> ...

Center content of UIScrollView when smaller

I have an UIImageView inside a UIScrollView which I use for zooming and scrolling. If the image/content of the scroll view if bigger than the scroll view everything works fine. However, when the image becomes smaller than the scroll view, it sticks to the top left corner of the scroll view. I would like to keep it centered, like the Phot...

iPhone: programatically press a button

Hi, Is it possible to press a button in iPhone SDK programatically without the user touching it? Thanks. ...

Does a CAKeyframeAnimation pick up the current state when a new CAKeyframeAnimation starts while another is running?

I wonder what would happen. i.e. I kick off a CAKeyframeAnimation, and while it runs I kick off another one on the same keyPath and object. I want it to pick up the current state, but unlike in the nice UIView CA wrapper methods, I don't see a "beginsFromCurrentState" property. So would it pick it up or not? ...

Memory Management Question in Objective C

I have a tableviewcontroller where I populate some data from a sqlite db and for each row, I download a file from a http server and cache it locally. I cache it only when the "detailsview" is opened. And the detailsview responds back to this table through a delegate after the file download is complete. But, when this tableview itself is...

Insert string at cursor position of UITextField

Hello, I've got a few UITextFields in an UITableView. The user should be able to insert only numbers and dots. To do this, I set the keyboard type to UIKeyboardTypeNumberPad and added a '.'-Button at the bottom left corner. Every time the button is pressed, a function is called. This function should insert a dot at the current cursor pos...

iPhone: Get camera preview

Hi, I'd like to get the image that is being displayed on the UIImagePickerController when user uses the camera. And when I get I want to process the image and display instead of regular camera view. But the problem is when I want to get the camera view, the image is just a black rectangle. Here's my code: UIView *cameraView = [[[[[[...

Need help with Segmented Control

I need help with the segmented control. I have put it in my window, and when I test run it, it is clickable. The only problem is I don't know how or where to code it so it works. ...

Getting text to save on iPhone

I am making an app the iPhone. I have a text field the user can type into and it's working, but I want it so you can press a button and it saves the text so when you close and open the app again it is still there. I have the button ("Done!"), but I don't know how to program it. ...

How to compare if two objects are really the same object?

I want to compare if an variable A represents the same object as variable B does. Could I do that with the == operator? Or what else is this exactly looking at? I think I need to check for the memory adress of the object where the variable is pointing to, right? ...

Proper way to add a title to a modal view controller's toolbar?

Right now I'm using this in my -viewDidLoad method: UIToolbar *toolbar = [[UIToolbar alloc] init]; UIBarButtonItem *flexibleSpace = [UIBarButtonItem alloc]; flexibleSpace = [flexibleSpace initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; // Add a back button to allow user ...

NSFetchedResultsControllerDelegate not firing

I can't figure out why, for the life of me, the NSFetchedResultsControllerDelegate methods are not firing when I add data to the underlying datastore. The data shows up immediately if I restart the iPhone application. I have subclassed UITableViewController and conform to NSFetchedResultsControllerDelegate: @interface ProjectListViewCo...

NSMutableString issue with NSXMLParser

I am having a heck of a time with this -- I am trying to parse an XML file and set the text in a NSMutableString variable in order to later fill in a label's text as you can see below. In my .h I have the following (simplified); NSMutableString *contentsOfCurrentXMLProperty; @property (nonatomic,retain) NSMutableString *contentsOfCurr...

File Formats Supported by UIWebView

What are all the file formats supported by UIWebView? In my testing, I found that it supports XLS, DOC, PPT, PDF but not XLSX, and DOCX, RTF. It supports image files like, JPG, PNG, GIF, BMP, not sure about TIFF or Exactly, what all types are supported is not clear... The UIWebView documentation also doesn't state it clearly. Could s...

Xcode App missing Cocoa Touch

In my Xcode App there is no Cocoa Touch. How do I fix that? What am I missing? ...

How to print a float value nicely?

Example: I have a float value like 1294322.0000000, and I want to print it out in a label, like that: 1.294.322 So at every thousands-position one point inbetween. I bet you know what I mean. Don't know the exact english words for that. Or, for example, I have a float like that: 15.29, then it should look like "15,29". Or a float li...

What describes NSNumberFormatter -maximumSignificantDigits ?

There's no text in the documentation about what that means, but it sounds very important to understand in order to not run into trouble. Does someone know what that is all about the "significant digits" of a number? ...

Why does my NSNumberFormatter object print "2" for input 1.0?

That looks like a bug in the API: When my input CGFloat is 0.0, I get this: Input = 0.000000, Output = +0 When my input CGFloat is 1.0, I get this: Input = 1.000000, Output = +2 Obviously that's not what I want ;-) Now here is how I create that NSNumberFormatter object: NSNumberFormatter *formatter = [[NSNumberFormatter allo...

Why would this NSNumberFormatter not display all fractional digits?

I have a NSNumberFormatter instance like this: NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatter setAlwaysShowsDecimalSeparator:NO]; [formatter setAllowsFloats:YES]; [formatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [formatter setMinimumFractionDigits:0]; [formatter setNumberStyle:kCFNumberFormatt...