iphone

cancel a background thread in Objective-C

How do I cancel a background thread in Objective-C? I am calling background threads like so: [self performSelectorInBackground:@selector(setupThumbnails) withObject:nil]; It is called when a swipe happens, for each swipe I want to cancel the previous background thread request. ...

UIOrientation returns 0 or 5

I am running a simple function that get's called in multiple areas to help deal with layout on an iPad app during orientation changes. It looks like this: - (void) getWidthAndHeightForOrientation:(UIInterfaceOrientation)orientation { NSLog(@"New Orientation: %d",orientation); end And I call it in various places like this: [self g...

Scale Entire UIView Proportionately

I have a base UIView which takes up the entire iPhone screen when the it is horizontal. When the device is rotated to portrait, I want the view to basically just scale down itself and everything in it to 2/3 the size and center it on the screen so everything is shown: Image: http://img25.imageshack.us/img25/3281/rotateqx.jpg I can't fo...

iPhone (iOS4): is it possible to play music/sound during an active call?

Hi all! I want to allow user to switch to my app during a phone call and play some sound that the second person will hear. I see here that it was possible even before iOS4 and here that no one knows how to do it. I will really appreciate if someone will spread some light on this issue. Thank you. ...

Automate ''I Agree" after opening a weppage.

I am writing an app to open a webpage but the page before asks for an agreement to use it. Can I write a script to outomate and save this response. Thanks ...

Back button on navigation bar triggers an action?

Is it possible that when I hit the back button on the navigation bar and after go back to the previous page and then trigger an action on the previous page? ...

iPhone: modalview not closing

I have a function, in UpdateViewController, that is being called by a delegate, MyDownloadController, that will close a modal view (which is the UpdateViewController). -(void)errorDownloading { self.downloadController.delegate = nil; [downloadController release]; [self dismissModalViewControllerAnimated:YES]; } I've trie...

iPhone Deck Game interface

Hello I wrote the code of a card game .. but now it's time todo the graphic and Interface What's the best approach to represent a card ?? a) CALayer b) UIView c) UIButton Which one is best to animate and receive user touches??? What do you recommend?? Thanks in advance ...

Loading a XML file and injecting data into a table and return it as a navigation/tableview

So here's the situation: I have a friend who wants me to make an app for his comic website, he wishes for me to set it up so the comics appear in a tab (navigation and tablelist/view). Im not sure what the best method for his XML file is, i do know of the xml code on how do it, but unfortunately, i do not know nor have ever used the code...

Add Custom buttons to Navigation Controller

I'm trying to either add 3 custom buttons to my navigation controller toolbar on the top of my view or add a segmented control with 3 options. I have the following code on my app delegate for when i create my view controller(fwc) but the buttons dont appear. /* Set up the navigation controller for the Feeding Tab */ // instan...

Getting back in the saddle ... guidance..... iPhone Development ?

I am in my mid - forties. I have always had a passion for Software Development. and a tremendous amount of respect for the craft. I, myself, am a Computer Science Major who graduated from college in the 80's. Back in the day, late 80's thru the 90's, I was a very good Borland C++ developer who developed SW as part of a team (I grew i...

How to refresh UITableView data?

I have a UITableView with two sections, which are both empty when my application launches. My app fetches the data from a URL, then puts the data into arrays (one per section) which should be used to supply the UITableView data for each cell. Calling [tableView reloadData] doesn't seem to refresh any of the data, or call any of the dele...

Xcode/GDB: How to get information about an exception that was just thrown?

OK, so imagine that my breakpoint in objc_exception_throw has just triggered. I'm sitting at the debugger prompt, and I want to get some more information about the exception object. Where do I find it? ...

iphone - can a bitmap be stamped in a path in quartz?

I have to draw a line between two points using quartz. At some point I have this code: CGContextBeginPath(ctx); CGContextMoveToPoint(ctx, lastPoint.x, lastPoint.y); CGContextAddLineToPoint(ctx, currentPoint.x, currentPoint.y); CGContextStrokePath(ctx); This lines will create a hard line between the points currentPoint and lastPoint. ...

Get a file from iPhone

I have a program which creates some files in the application's Documents directory. I need to get those files from the device for debugging. How can I do it? I am looking for a way to not need jailbreaking, partly because I have to figure out which million letter directory to attack, and partly because I will be talking to Cupertino in ...

"Not Writable! - Root.plist" greyed out when building

Hey Was having a play with settings bundles just before in xcode 3.2.3 (sdk 4.0.1), but then I deleted the settings.bundle folder and 'also moved to trash'ed. Now every time I build I have a dialogue "Save before building?" and the root.plist file there, but greyed out and unselectable. I checked the directory where it was claiming t...

app runs as debug, but crashes as release

I have a program which runs fine on the device in Debug configuration, but fails as a Release. Anyone have this experience, and how do I fix it? Thx ...

iPhone - How to select and show a single record in Grouped Table View Format

Im making a iPhone app which includes a list of sports teams. RootViewController lists all the teams in a table view. When I click a row I want to load up a TeamViewController, which just shows the record for a single team. The catch is Im wanting to display that single teams details in the Grouped Table View Style. This is causing m...

Exception when sorting NSMutableArray which contains all NSDate objects.

//list has type of NSMutableArray NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:YES] autorelease]; [list sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; I got this exception: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<__NSDate 0x5d57980> v...

Save Image on iPhone idle time

Hi all, I want to save the loaded image from server in idle time.I use the following to to save image in iPhone memory. - (void)saveImage:(UIImage *)image withName:(NSString *)name { NSData *data1 = UIImageJPEGRepresentation(image, 1.0); NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *paths = NSSearc...