cocoa-touch

This loop chokes on 50,000 lines on the iPhone... can I improve it so it doesn't?

FILE *file = fopen([gpsFilePath UTF8String], "r"); char c[1024]; while(fgets(c, 1024, file)!=NULL) { NSString *cString = [[NSString alloc] initWithCString:c encoding:NSMacOSRomanStringEncoding]; NSArray *split = [cString componentsSeparatedByString:@","]; if ([split count] !=...

Is there a way to figure out what's the current affecting speed in a timespace?

Timespace problem: You make a big hierarchy of views, and give every layer a different speed value. Now all the Timespaces are messed up. At the bottom of the hierarchy you don't know what kind of time distortion you have. -10%? -90%? +50%? UIKit somehow has to calculate the speed in the hierarchy when animating. So I wonder if there's...

What do they mean by "the timespace of the animation's layer" and "in the local active time"?

They say: The timing protocol provides the means of starting an animation a certain number of seconds into its duration using two properties: beginTime and timeOffset. The beginTime specifies the number of seconds into the duration the animation should start and is scaled to the timespace of the animation's layer. The...

How to detect if the iPhone is using Wifi GPS, or their default wifi loation?

When the iPhone can't find a GPS signal, it uses Wifi to guess at your GPS location. When it can't find your Wifi location, it defaults to the wifi network where you activated your phone. Is there any way to determine when these two forms of location are occurring? The LocationManager provides a horizontalAccuracy reading, but if you ...

Load image from url in iPhone, only if small

I'm using initWithContentsOfURL of NSData to load an image from a url. However, I don't know the size of the image beforehand, and I would like to the connection to stop or fail if the response exceeds a certain size. Is there a way to do this in iPhone 3.0? Thanks in advance. ...

Add images via Push Notification Service?

I have a content app and would like to notify users of new content using Apple Push Notification Service, bypassing the now very long App Store submissions. Once the user receives the notification, a download update button will become enabled. The user will download an sql file plus images from my website. The sql file will execute in...

Can you force a touch event to cancel after touchesBegan?

Given a certain state of one of my UIViews I'd like it to respond to touchesBegan and then cancel any further touchesMoved/Ended that continue from that particular touchesBegan event. Basically I have an UIView subclass at rest and if it's touched I'd like to move some other UIViews out of the way... then the next time it's touched the...

Cocoa Touch - UISearchBar Keyboard - Hide 'Search' Button

Hi all, On my iPhone app I'm using a UISearchBar (without a Search Display Controller). I have my own 'Search' button as a UIButton and therefore on the keyboard that pops up when editing begins on a UISearchBar I would like to constantly hide the 'Search' button on it as it is unusable. How could I go about doing this without the Searc...

Checkbox image toggle in UITableViewCell

I need some guidance on creating a UITableViewCell that has an image on the left which can be toggled. The image should be tappable and act as a toggle (checkbox). My parts I'm struggling with are: How do I detect taps on the image and handle those differently to didSelectRowAtIndexPath? How do I change the image without performing a...

Reload model for UITableViewController before [tableview reloadData]

This is my first try into iPhone development and I have some UITableViewControllers which will show the data returned from a webservice. In my AppDelegate I have setup a timer which is called every few seconds and reloads the model. I keep the same object reference and just refresh it's contents, so I have the same object on any UITable...

Multiple Modal-view Transitions Crash App

I would like to present multiple modal views in sequence (e.g. show confirmation page after selecting a picture from image picker). My problem is that the animation of dismissal and presenting in subsequent steps without delay always crashes the app with an EXC_BAD_ACCESS. I assume that the problem is that CoreAnimation does not distin...

Can We resize the UIDatePicker View in iPhone

Hi, I want a UIDatePicker View in a smaller size with respect to what it comes with. Is it possible to resize it? ...

Cocoa Touch UIViewController Properties and class design

I'm creating a custom ViewController. This VC needs to load some data that is known in the event that creates it and pushes it to the top of the NavigationController that it is going to be part of. My question is, how should I pass data from the view that handles the custom ViewController's creation into that custom ViewController. ...

Detecting Touch on PNGs with Alpha

I am trying to detect a touch event on a PNG image loaded into a UIImageView. I have everything working fine except that the touch is being tested for the bounding rectangle around the image (as expected). What I would like to do is test if the user has selected part of the visible PNG as opposed to the UIImageView itself. For example ...

Acceptable (by ) HIG friendly approach to temporarily highlight a UILabel

I'd like to draw attention temporarily (±1 sec) to a value in a UILabel when a user changes something elsewhere on the screen. I know Apple is pretty particular about what and how people add "pizazz" to their apps...and for the most part I think it's for good reasons but in my case I feel my UI would really benefit from a subtle animated...

iPhone App Crashes on Launch Due to Inconsistencies?

Something really weird has happened to my source code. The application always built successfully, and I always used to be able to launch the application. However recently, the app crashes when I launch it and return the following error in the console: 2009-07-23 20:30:06.390 App[15652:20b] Database Successfully Opened :) 2009-07-23 20...

How do I create an HTTP connection and log in on the iPhone?

I am trying to log in to my website (www.trailbehind.com) and then send a POST request to upload a file. I tried implementing some code just to request the home page without authenticating, which I found here: http://developer.apple.com/documentation/Networking/Conceptual/CFNetwork/CFHTTPTasks/CFHTTPTasks.html#//apple_ref/doc/uid/TP3000...

How do you get the int and modulo (mod) of division with an NSDecimalNumber

I am confused by NSDecimalNumber and its "behaviors". I have an NSDecimalNumber that represents a dollar value, say $37.50. I'd like to find out how many times say 5.0 goes into that number and then know what's left over. I can get the straight division and get 7.50 but I want 7 mod 2.50. I could convert to an integer but need to save th...

can anyone send me some good links on cocoa touch framework ?

I am new to iPhone application development so that i want to learn cocoa touch framework. As i want to read on cocoa touch framework if anyone can help me to find some good resources to learn the framework as ebooks tutorials and videos it will be very useful to me . ...

Disabling Keyboard

How to Hide Keyboard by pressing Returnkey ...