iphone

How can I change the animation style of a modal UIViewController?

I'm currently displaying a UIViewController like this: [[self navigationController] presentModalViewController:modalViewController animated:YES]; and hiding it like this: [self.navigationController dismissModalViewControllerAnimated:YES]; The animation is "slide up from the bottom"... then slide back down. How can I change the ani...

adding multiple views to view controller inside a tab controller

I have a tabview controller to which I added a UIViewController to each tab. I want to have multiple UIViews inside the UIViewController. So in the implementation of the UIViewController class I added [self.view addSubView:uiview1] and [self.view addSubView:uiview2]. The problem is that when I run the app, it crahes on load. However, i...

How do I do inline assembly on the IPhone?

How is it done? What steps do I need to take and what pitfalls and gotchas are there to consider? ...

Can an iPhone or iPod Touch communicate with another device in the same room?

I'm new to developing applications for the iPhone and iPod touch. Is it possible to communicate directly between 2 devices in the same room by using WiFi or perhaps even BlueTooth on the iPhone? I've seen a demo of a fire application where one iPhone "lights" other iPhone when they get close to each other. How is this accomplished? T...

iPhone SDK: Advancing from one view to another using a button tap

I want to make a really simple iphone app: one screen with a single button... when the button is tapped a new screen appears. That's it. No animations, nothing, I've tried endlessly to make the NavBar sample project do this... and it works but only if I use a UINavigationController with a table that I can tap etc. I've tried all the...

How do I associate a nib (.xib) file with a UIView?

I have a subclass "s" of UIView. I want to put some buttons and labels on s. How do I associate my UIView subclass with a nib file? ...

How to do a flip animation between more than two UIViews?

I have animation code in a class that extends the UIView: // Start Animation Block CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:[self superview] cache:YES]; [UIView setAnimationCurve:UIViewAnimationCurveEa...

How do I move the UIView to the "bottom" so that the next UIView displays?

I want to "remove" a UIView from a superview and add it again at the end... but at the "bottom" of the rest of the UIviews that belong to the superview. Is this possible? Any help is very appreciated! ...

Tell-A-Friend kind of form in iPhone SDK

Hey! I'm trying to build an in-game Tell A Friend form like in AppStore. Does anybody know if it can be found anywhere in the SDK? I wouldn't like to reinvent the sliced bread. Thanks! ...

How can I reformat a PDF file for easier reading on iPhone?

I'd like to read an arbitrary PDF on my iPod Touch (or iPhone) with a reasonable font size. Some PDFs are already formatted with narrow columns and wide margins. Once I zoom the document to "remove" the margins, the text is easy to read. Most documents have one very wide column of text. When I zoom in enough to make the text readable,...

How to change the name of an iPhone app?

I began an iPhone project the other day with a silly development code name, and now I want to change the name of the project since its nearly finished. But I'm not sure how to do this with XCode, trying the obvious of changing the application's name in the pinfo, causes the signing process to go wrong (I think...) and my app won't laun...

Handling touch events within a child UIScrollView.

I'm displaying a series of images in a UIScrollView. I pretty much want to replicate the Photos application. My current architecture is: A parent UIScrollView with content size that is wide enough for x number of pages + some extra space for margins in between the images. Each image is contained in a UIImageView. Each UIImageView is ...

How do I make a UIView "scrollable" in my iPhone app?

I have a UIView that will eventually contain about 2 screens worth of information. I want to give the user the ability to scroll down via flicking (just standard flicking like in Safari). How do I do this? ...

Have you ever been barking up the wrong tree for hours?

I'm writing my first iPhone app, so there is a lot of guessing about how things work. The objC memory model takes a while to get used to. After adding some code I got stuck in applicationDidFinishLaunching. The app was crashing while sending a message to an object which I was sure should have been created at that point in the code. The...

Parsing an NSXMLElement in Cocoa

Hey all, I'm trying to use XPath to parse an XML document. One of my NSXMLElement's looks like the following, hypothetically speaking: <foo bar="yummy"> I'm trying to get the value for the attribute bar, however any interpretation of code I use, gives me back bar="woo", which means I need to do further string processing in order to o...

What is the quickest way to get the String contents of a URL using Cocoa/iPhoneSDK?

Say I want to get the HTML of http://www.google.com as a String using some built-in classes of the Cocoa Touch framework. What is the least amount of code I need to write? I've gotten this far, but can't figure out how to progress. There must be an easier way. CFHTTPMessageRef req; NSURL *url = [NSURL URLWithString:@"http://www.goog...

How do i tell my application to close?

I have just discovered the nifty unhandled exception handler for cocoa-touch. Now that i can gracefully notify the user about any unhandled exceptions that might crash my application. I'd like to shut down my application after notifying the user that a crash has occured. Does anyone know how to shut down an application programmaticall...

How could I store Image retrieved from web, into application bundle?

Hi I am developing iPhone application and In that application I've one TableViewController, and that TableViewController made up of Custom table cell. into those cell I am loading image from URL, but the scrolling is not that smooth,(because each cell load images everytime when scrolling happen.) So I decided to store those images into...

How to "rotate" a layer/view (e.g. just like you would in enigmo)

I know how to move a layer based on touch. But I would also like to be able to rotate the image. Is there any sample code that shows how to do this? Or can anyone give me some advice? Thanks! ...

Pass values between Views

I have MainViewController calling WebViewController (From UICatalog sample application) In WebViewController I make some function setValue(){...} to set some value passed as parameter to the variable (NSString *value) from WebViewController.h but when I try from MainViewController something like WebViewController targetViewController... ...