iphone

dismissModalViewControllerAnimated nonatomic?

I have a weird timing issue, it seems. I open a uiimagepicker as a modal view. When the user picks an image or I want to take the image, save it to a variable, then open an email interface as a modalview. My problem is that I am calling dismissModalViewController on the imagepicker, then calling presentmodalviewcontroller for my email...

iphone sdk - Remove all characters except for numbers 0-9 from a string

OK So here's the plan. The XML I'm getting data from allows non-numeric text in phone number fields (for descriptions or contact names, etc). I am trying to extract only the numbers and call the tel: URL with them to initiate a call. Here's whats NOT working: NSCharacterSet *charset = [[NSCharacterSet decimalDigitCharacterSet] invertedS...

@synthesize vs @dynamic, what are the differences?

what are the differences between implementating a @property with @dynamic or @synthesize?? thanks. ...

how do I detect the iPhone orientation before rotating

In my program I'm moving things based on rotation, but I'm not rotating the entire view. I'm Using : static UIDeviceOrientation previousOrientation = UIDeviceOrientationPortrait; - (void)applicationDidFinishLaunching:(UIApplication *)application { [window addSubview:viewController.view]; [window makeKeyAndVisible]; [...

Why won't my objective c implementation file recognize my import statement

Here is my header file #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <PolygonShape.h> @interface Controller : NSObject { IBOutlet UIButton *decreaseButton; IBOutlet UIButton *increaseButton; IBOutlet UILabel *numberOfSidesLabel; //IBOutlet PolygonShape *shape; } - (IBAction)decrease; - (IBAction)incr...

heightForRowAtIndexPath for longer NSStrings

I have a UITableView (Grouped!) and need to calculate the height of two styles of cells: UITableViewCellStyleDefault and UITableViewCellStyleValue2. This is how I do it for UITableViewCellStyleDefault: CGSize textSize = {300.f, 200000.0f}; CGSize size = [myTextString1 sizeWithFont:[UIFont systemFontOfSize:14.0f] constrainedToSize:tex...

How does one subtract hours from an NSDate?

I would like to subtract 4 hours from a date. I read the date string into an NSDate object use the following code: NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; NSDate * mydate = [dateFormatter dateFromString:[dict objectForKey:@"published"]]; W...

Iphone Binary submitting tutorial ???

Alright I got my iphone application completly done and have done all the steps to get it submitted except for uploading the binary. Is there a step by step tutorial out therefor getting the binary all ready for uploading cause I'm completly lost. I just signed up for the developers program last night and am not sure if I need to download...

What does error conflicting types for '' mean?

i got an error that said "error: conflicting types for '____'. What does that mean? ...

AVAudioPlayer resetting currently playing sound and playing it from beginning

I'm having an issue using AVAudioPlayer where I want to reset a player if it's currently playing and have it play again. I try the following with no luck: The sound plays once but then the second time i select the button it stops the sound, the third time starts the sound up again. //Stop the player and restart it if (player.playing) ...

SQLite + Core Data Vs. File system on Iphone App that shows photos. What's more performant?

Hello, I have an application where the user will navigate around a set of photographs. What's best in terms of performance for this scenario, SQLite + Core DATA for persisting the photos as NSData objects or having the photos as png files directly on the file system? thanks. ...

Threads, TableViewController, View Transition Question. iPhone

In my app when a user clicks a button I want to show a loading screen, then call a method that will load the data from the network and then load a view that displays the data in a UITableView. I have everything working except showing the loading screen. (UI hangs due to the fact that the network data/parsing logic is executing) Can anyon...

The peerID used in GameKit framework, is always unique for each device?

Hello. The peerID assigned to your device in a GKSession, is it always the same for the same device? I mean, every time you create a GKSession, your peerID will be the same one? or a random one is assigned everytime you create a GKSession? How is this peerID generated? thanks! ...

Online Python interpreter for use *from* the iPhone?

Is there an online Python interpreter or some such that would allow me to try out simple python code from my iPhone? Something like try ruby! (in your browser) for Python, and works with the iPhone? ...

UIProgressBar loading NSMutableDictionary

I'm my program i'm loading a fairly large MutableDictionray and I would like to use a UIProgressBar. Does anyone have a suggestion of how to determine the loading time to make this work? Thanks ...

How start a debug session in the simulator with previous app state

I have a hard-to-catch error that only happend the 2 or 3 time I start my app, after a previous failure of it. But because when I do Run&Debug from the XCode menu the app is delete from the simulator or device, I can debug it to find what is happening. I try to attach to the process, but when I succed is too late and the app crash. I h...

Why should I use an CATransaction in an animation?

I've found this code snippet: [self setValue:direction forKey:@"currentDirection"]; CAKeyframeAnimation * animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; animation.path = path; animation.duration = grids * gridWidth / [self speed]; animation.fillMode = kCAFillModeForwards; animation.removedOnCompletion = NO; animati...

Prompting and Delegate question

I have a class that needs to ask the user a question and wait for the users response to determine the next action. What would be the best way to do this? Using a delegate? How? I have a UITextField and a UITextField in the class. Thanks ...

Custom UITableView section header views are breaking

I have a custom UIView subclass that i'm trying to use as a header for one of my grouped tableview sections. I save an instance of that view in the tableViewController and use that to return the height for the header section as well as the view itself. the problem is that somehow that instance variable changes from a UIView to a CALaye...

Library for Caching Web Pages on iPhone?

Is there a library or framework that I can use to cache web pages locally for offline viewing on iPhone? If not, what's the best strategy for doing so? Currently what I'm thinking of doing is downloading the HTML, harvesting its URLs, caching those URLs, then rewriting the HTML to point to local files. Is that the best way to do it? Th...