iphone

Are keys and values in an NSDictionary ordered?

I mean: Is the order of keys and values in an NSDictionary always the same like how they were specified when initializing the NSDictionary? Or should I better maintain a seperate NSArray if I really need to know the order of keys? ...

how to reload UIPicker elements - iPhone

I have seen many application reloading table data & table. My Question is "Is it possible to re-load a picker view elements?" [tableView reloadData]; this statement - refreshes the tableView, How this is possible in UIPickerView elements? ...

Moving an imageview alonge a path

Right now I know how to move an object in a certain direction at a set speed but am not sure how to move an imageview from one CGPoint to another along a set path without using animations so it can be interactive. Also is there a way to apply a slope while it's traveling from point A to B so it appears to curve as it moves. What I'm tryi...

iPhone App: Reloading Webview with Tabs

In my application, I want to have a Webview and a button on the bottom bar (should it be a tab, bar button, or navigation item?). In this Webview, it will display a web page of user information. For example, user profiles on a website. Example URL: http://myusersite.com?uid=1 What I am trying to accomplish is allow the application use...

When to use #import & when @class - iPhone

I have already created a class named "Category" In some online examples I have seen - they have implemented #import "Category.h" In some examples - class in pre declared like @category before @interface new class So I am confused => When to use #import & => When to use @class? ...

Memory management and performance

If I allocate an object in a method, 'getASprocket' and call it this way, will there be a leak here? Sprocket *sprock = [Sprocket getASprocket]; // store this returned value as an ivar ivarSprock = [sprock retain]; // release the originally acquired object [sprock release]; The Sprocket object is allocated and returned this way: – ...

How to drag, toss, animate a view along a curved path.

I have an view-based iPhone app. Currently there is a small image in the top left hand corner of the screen. When the user taps the screen the image is animated using a CAKeyframeAnimation along a curvy path to the lower right hand corner of the screen. Now I want to change the app so instead of animating on the tap event, the user can ...

How do I make sure that a tableViewController view takes up the full screen?

In the viewDidLoad method I add any combination of these and I can't get it to work: CGRect appFrame = [[UIScreen mainScreen] applicationFrame]; [[self tableView] setBounds:appFrame]; // self.view.frame = appFrame; // self.view.bounds = appFrame; // [[self tableVew] setFrame:appFrame]; self.view.autoresizingMask = UIViewAutoresizin...

What is the relationship between anchor points as set in Interface Builder and for the view's layer?

I'm rotating a view that's placed in Interface Builder using CGAffineTransformMakeRotation, but even though I have the anchor point set to the top left in Interface Builder the rotation still happens around the center of the view. As a crappy work around I am setting the anchor point upon startup and then repositioning the view, i.e.: [...

Is it necessary to cache common operations for -drawRect: on the iPhone?

This is a rather simple example and probably wouldn't make much of a difference anyway, but say I have this drawing code in a view to draw a gradient: @interface SomeView : UIView @end @implementation SomeView - (void)drawRect:(CGRect)rect { const CGContextRef ctx = UIGraphicsGetCurrentContext(); // Set fill color to white ...

get size of a uiimage (bytes length) not height and width

I'm trying to get the length of a UIImage. Not the width or height of the image, but the size of the data. Thank you. ...

How to change UIPicker Color ? iPhone

I have observed that UIPicker always remains in black color, Is there any way to change the color of UIPicker & it's Selection Indicator? Thanks for helping me. ...

How do I programmatically play an MP3 on an iPhone?

I'd like to include an MP3 with my app and play it on demand. Unfortunately I am not sure how to get started. I keep reading about .caf files, but I am not sure what those are. I am looking for a step by step, if possible. ...

Stretching An Image in Tableview

What else is needed to display image to full tableview width? UIImage *image = [UIImage imageNamed:@"balloon_2.png"]; [image stretchableImageWithLeftCapWidth:15 topCapHeight:13]; cell.image = image; ...

Loading a Nib within a Nib

I am new to interface builder and I would like to have a screen which contains a 3x3 grid of a UIView each of which contain a UIImageView, and 4 UILabels. My logic is probably flawed but the way I am trying to achieve this was to: Create a UIView Nib file MyUIView.nib and layout in IB with an imageView and 4 labels Create a UIView su...

Decimal point adjustment for string in iPhone.

Hello all, I want to display a number in decimal format only if the number is not an integer. Like if the number is float it must be displayed with one decimal point. But if the number is an integer it must be displayed without a decimal point like its shown in the following link(second part of the code) http://www.csharp-examples.net/...

Versioning a persistent keyed archive?

For my current app I'm using the NSKeyedArchiver approach to persist my objects to the iPhone between launches. I'm wondering if it makes sense to tag this file when it's created with a version number so that in the future when the app revs we'll know what kind of data we're dealing with should migration be necessary. Is this recommended...

release mpmoviecontroller from another view

I have the mpmoviemovie controller over which I have 2 more views. One of the view has a button over it. On the action of those buttons i want to stop and release the player. hwen I try to release the subviews NSArray* SubViews= [[self.view superview] subviews]; for (int i=0 ;i<[SubViews count]; i++){ [[SubViews objectAtIndex:i] ...

Playing Audio on the iPhone

I want to play prerecorded audio for users in an iPhone application. Is the best way to play this audio to use openAL? Is there any other way that might be beneficial for what I want to accomplish? Thanks! Joe ...

-copyWithZone: error when opening UIActionSheet after table cell selection

I am using a custom UITableViewCell subclass to provide content in my tableview. The cell subclass is called ValueTableViewCell. When this specific cell is selected, a UIActionSheet is to appear. UIActionSheet *genderSheet = [[UIActionSheet alloc] initWithTitle:@"Choose Gender" delegate:nil cancelButtonTit...