NSNumberFormatter for rounding up float values
Hi I have a CGFloat value which I want to round to 3 digits after the decimal point. How should I do this? Thanks. ...
Hi I have a CGFloat value which I want to round to 3 digits after the decimal point. How should I do this? Thanks. ...
In my iPhone app, I have put a UIBarBUtton of type UIBarButtonSystemItemTrash in my UIToolBar. When pressed, I'd like to replicate the animation of Mail.app: the bin opens, the UIView folds and flies into it. Is there a way to access this animation ithrough the iPhone SDK? Presently I am using a custom made animation, but there are so...
I have an idea for a simple application to run on an iPod. I'm an experienced programmer but have no experience on iPod or any Mac or Apple operating system. What are the bare essentials in terms of hardware and software to begin developing using a PC as the development platform? Does the PC need to be running Linux? ...
I'm logging a bunch of data with NSLog(). Is there a way to capture the log data when my iPhone is not connected to my development machine and running under a debugger? For example, can I redirect it to a file and then read the log file back through Xcode at a later point in time? I need to do this in order to test my app when the W...
Coming up towards the end of developing an iPhone application and I'm wondering just how bad is it to use autorelease when developing for the iphone. I'm faced with some fairly random crashes and, so far, I can't pinpoint it to anything other than sloppy memory usage. As a Cocoa newbie I remember initially reading a guideline document ...
When retrieving objects from an NSMutableArray in cocoa-touch is the below code ok? Should I be allocating([alloc]) new Page objects each time or is just pointing to it alright? Do I need to do anything to the Page *pageObj after, such as set it to nil? const char *sql = "insert into Page(Book_ID, Page_Num, Page_Text) Values(?, ?, ?)"; ...
I'm trying to set the editing style property of a UITableViewCell in a Cocoa Touch (iPhone) app. For an example of what this looks like, check out the Contacts app, where you can see the little green plus sign to the left of some of the cells. The UITableViewCell inspector in Interface Builder has an editing style drop down, but it d...
I'm trying hard to understand when and what I must relase in Cocoa Touch as it doesn't have garbage collection. This code block is from apples iphone sample PeriodicElements and they release anElement and rawElementArray but not thePath, firstLetter, existingArray and tempArray? I would have thought that at least tempArray and existing...
Right, I'm trying to get a label with text in it (done already obviously), which scrolls across the screen. The text that is input into the label is done by a UITextField and a UIButton. This updates fine. But I'm trying to get the UILabel to resize accordingly to the amount of text input, so that the WHOLE lot of text scrolls across t...
Okay, I've got my normal app which is in portrait mode. I can force my app to go to landscape mode for a view (using navigationcontroller and viewcontroller) like this: - (void)viewWillAppear:(BOOL)animated { [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; } But then when I go back to the main menu ...
I need to record a video of a multitouch game I'm working on, and I'd like to record it from the simulator. My idea was to send touches from the device to the simulator (like this project does with the accelerometer). Just by googling I haven't found anything like that, but before I start implementing it I thought I'd ask here if anyone ...
I've got a UIImageView with about 10 full-screen jpegs, totaling about 128k. Throwing these into the UIImageView with setAnimationImages works like a champion in the emulator until I try to run it on the iPhone which results in a fail. Is something wrong here? I would think with all the fancy 3d games I've seen my crappy little animat...
I'm following along with this useful looking answer to my question. It seems to be working, but here are two questions I have: How do I detect an HTTP error? The didFailWithError method doesn't seem to be getting called? UPDATE: It considers any response a success. So I guess I have to handle HTTP errors in the didRecieveResponse m...
Is there a general template or tutorial or web page that describes the procedure for creating a UIPickerview which selects short sound files and plays them upon selection or with a player? Thanks ...
I have a UITextField set up in a UITableViewCell, for a control mimicking that in Apple's own Contacts app, when you go to edit a field. This is all mostly working fine, except for a little UI bug. The UITableView is part of a UIViewController created and loaded from a XIB, but the text field is being created programatically (and becomin...
I have got my own custom UIViewController, which contains a UIScrollView with an UIImageView as it's subview. I would like to make the image to auto rotate when device orientation changes, but it doesn't seem to be working... In the header file, I've got; @interface MyViewController : UIViewController <UIScrollViewDelegate> { IBOutle...
I'm on the final stretch of my first simple iPhone application. I'm building an "about" view, with credits/info/etc. I am failing on the simplest thing: how can I embed hyperlinks into the text? I'm current using a UIView with a UILabel for the text. I've looked on here, and the sample apps, but not got anywhere. Should I use a UIWebVi...
In my iPhone app I employ NSDecimalNumber to store some some currency rate values. I pull the data from the web the first time the app is launched and then again when they become obsolete, and I store them in a NSDictionary; then I use writeToFile:atomically:. When the app is launched for the first time, my rate conversion method works ...
I'm trying to display a table full of twitter statuses (yes, this is the Stanford Presence 2 assignment), which are variably sized. I can relatively easily determine the appropriate height for my rows with code that approximates (from accompanying lecture 9): - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSInde...
I have a UIView with a navigation bar. How can I hide the navigation bar when the user puts the iPhone in landscape orientation, and have it show again on portrait view? ...