cocoa-touch

UITabBarController for main & about views?

I have two screens on my app that I want to present to users, the first is the main screen and the second is an about screen, brief instructions / credits. Currently I have this setup as a UITabBarController with two buttons and two views. Is this approach acceptable? ...

Adding picture in pickerview

UIImageView *one = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball1.png"]]] ; UIImageView *two = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathCompon...

How can I parse raw email source and extract the HTML part?

In my iPhone app, I'm handed the raw source of an email, in RFC822 (or "eml") format. I'd like the HTML part of this message (if one exists). Rather than attempting to parse it out myself and converting escape chars and so on, I thought I'd check to see if anyone knows of an objective-c library to do this for me. In .NET, I've always u...

How to detect if certain characters are at the end of an NSString?

Let's assume I can have the following strings: "hey @john..." "@john, hello" "@john(hello)" I am tokenizing the string to get every word separated by a space: [myString componentsSeparatedByString:@" "]; My array of tokens now contain: @john... @john, @john(hello) I am checking for punctation marks as follows: NSRange textRange...

Passing touch events on to subviews

I have a view within a UIScrollView that loads an additional subview when the user presses a certain area. When this additional subview is visible, I want all touch events to be handled by this - and not by the scrollview. It seems like the first couple events are being handled by the subview, but then touchesCancelled is called and the...

Loading a UIView with a UITableView from another NIB

I have a NIB that contains a UIView. I have another NIB that contains a UITableView. How can I load the UITableView NIB inside of the UIView in my other NIB? ...

Row index of pickerview is not displaying correctly.

I had used images in pickerview. But the row number is not displaying correctly. Anyone please help. I used the below code : - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { NSLog(@"Row : %i",row); return [customPickerArray obje...

UIViewController takes up entire screen in Interface Builder

I have a NIB with a UIView that contains some UILabels, UIButtons etc. and a UIViewController that is loading a UITableView from a detached NIB. I want the UITableView in the UIViewController to be positioned below my UIView, but whenever I add it in Interface Builder it takes up the whole screen, and my UIView becomes part of the UIVie...

Changing text size in Pickerview

How can we change the size of the text in a picker view? Anyone please help. ...

How to load a NIB inside of a view in another NIB?

I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib contains a UIButton I want ChildViewController.xib to load in the ParentViewController.xib's UIView I have done the following: Created @property for UIView in ParentViewContro...

UISplitViewController: remove divider line

When using UISplitViewController on the iPad there's a black vertical divider line between the root and detail view. Is there any way to remove this line? Thanks ...

How do I remove those rotation artefacts from my CATiledLayer?

Hello all, I have a CATiledLayer into which I render content in the following method - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx I used the QuartzDemo code to draw a pattern. This works very well until I apply a rotation transform to the layer's parentLayer (a UIView): rotated: These zigzag artefacts become w...

How do UIImageView autoresize according to UIImage's size

How do UIImageView autoresize according to UIImage's size? imageView.image = image2; Now, the size of image2 is (Width = 123.0; height = 123.0); and the size of imageView is (Width = 18;height=18); My problem is, could imageView autoresize to (123.0,123.0) ? I have all type of the property UIViewContentMode, but imageView didn't change...

Do somthing when animation is ready.

Hi! I have a animation in my navigationbased application. [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.5]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view ca...

How to add another subview to a NavigationController view

I have a window and add a navigation controller's view to it, all I want is for the navigation controller's view to take half of the window (top half) and want to add another view to bottom half. I'm trying to set the frame for navigation controller's view, but 0,0 is the topmost point on screen (doesn't count the iPhone's status bar). I...

How can get the values of NSDictionary using keys where the dictionaries are stored in NSArray ?

I have created 5 NSDictionary's. I stored them in NSArray. I need to get the values stored in NSDictionaries. How can do it ? I tried calling [[array objectAtIndex:i]objectForKey:key1]. But, it is crashing by giving the message:unrecognized selector sent to instance How to get the data ? NSDictionary *enemy1, *enemy2; NSArray *enemyDat...

Which font and size does apple use for the navigation bar title?

I made an totally custom navigation bar and would like to use the exact same font and size like apple does for the title of their navigation bar. It looks like some kind of fat printed arial, but not sure if that's right. Does anyone know? ...

iPhone app crashes on start-up, in stack-trace only messages from built-in frameworks

My app some times crashes at start-up. In stack-trace only messages from built-in frameworks. An excerpt from a crash log: OS Version: iPhone OS 3.1.3 (7E18) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x000e6000 Crashed Thread: 0 Thread 0 Crashed: 0 CoreGraphics ...

Best approach to make Page Flip animation on iPhone (like magazine)

Hi all, What would be the besta approach to make one oage flip like a real magazine, like I put the finger in the corner of the screen then flip the page... Like this video: http://www.youtube.com/watch?v=dy4Y9j7COgg&feature=related Is it a sequence of images ? all images are in one view or Imageview ? Or there is another way to ...

Open a PDF file in an external app on iPad

I'd like to make my app to open a specified PDF by an external app of the user's choice on the iPad. How can I do that? Or, is there any open-source PDF reader framework available so that I can put it into my app? My situation in more detail: I'm thinking of porting to the iPad from OS X / rewriting from scratch for the iPad an app whi...