iphone

Are system framework leaks my fault / preventable in iPhone SDK?

This is a bit of a general question, I am debugging and testing on the iPhone and the leaks performance tool is reporting a ton of relatively small leaks from code that I didn't write. I.e. in the responsible frame column the following are blamed for leaks: [UIColor allocWithZone:] NSKeyedUnarchiver NSCFString copyWithZone CGTypeCreate...

How to import contacts from Mac OS X AddressBook into iPhone Simulator

Is there a way to import contacts automatically from my Mac OS X Address Book into the iPhone Simulator Contacts app? Or vCards or anything like that? I'm building an app that displays contacts in various ways and I'd like to have a way to have lots of contacts without typing them all in myself. ...

iPhone: How do I get the the UINavViewController to not pop the view controller when the user presses the tab that is already selected

I've got a Tab Bar, and each of the tabs' view controllers is a nav controller. If you press on a tab that is already selected, it pops the view controller back. for one the tabs, i want this not to happen. What do i make a delegate of? I tried overriding -(UIViewController *)popViewControllerAnimated:(BOOL)animated in the nav control...

CGPointMake question for iphone?

I have birds flying within a frame in my game, but I can only get them to fly in two different directions. If there are 2 birds they go in two different directions. If there are 3 birds, 2 of them go in one direction and the other one goes in a different direction. I want the birds to randomly go in four different directions. Up right...

iPhone - Custom Tab Icons, Remove Highlight

I am creating a custom tab bar for my iPhone app and I need to change the images. I have changed the actual tab bar background, but I need to know how to add custom images for the icons and their respective "selected" icons. I also need to remove the square highlight that is default. Pretty much, it just needs to be my icons. Also wonder...

UISegmentControl switch views??

Hello all, I have a UISegmentControl in my app and im trying to make it switch views like the app store. Ive tried this code with no luck: - (IBAction)segmentSwitch:(id)sender { UISegmentedControl *segmentedControl = (UISegmentedControl *) sender; NSInteger selectedSegment = segmentedControl.selectedSegmentIndex; if (selectedSegm...

iPhone - Gestures on UIPickerView and UIWebView

I'm making an iPhone app in which the user can do gestures (left and right swipes) to flick through tabs. My problem is that some of the pages have views such as the pickerview, webview, textfields and buttons. The swipes don't work on these. Is there any way to have global gestures? For reference, my gesture code example: //Swipe betw...

AVAudioPlayer initialization error 1685348671. How to check whether file is valid?

Hi I am using AVAudioPlayer to play some ima4 files. The initialization of the player keeps failing with error code 1685348671 (dta) which according to the documentation means The file is malformed, not a valid instance of an audio file of its type, or not recognized as an audio file. Available in iPhone OS 2.0 and later. Wh...

difference between CGContextDrawImage et UIImage drawInRect

Hello, I was wondering which method is the best when there is a need to scale images? Do you have benchmarks on this? Thanks in advance. Regards, ...

Copying whole object graph - copy a relation

I have a model with 2 entities: RealEstate and Container Containers object are already saved onto the persistent store with the following hierarchy: Container 1 Container 2 Container 3 Container 4 Container 5 Container 6 Each container has a RealEstate owner (in a given hierarchy the realEstate is always the same)...

iPhone: Displaying Date in a Label and String Manipulation

In order to learn some basics I've undertaken creating an app that displays two quotes a day. I'm having trouble figuring out how to work with the current date, which will be pretty necessary if I'm going to get this thing running. My current plan is to name my .txt files with the quotes by day, and then get my filePath string to con...

If statement question iphone?

I am creating a game where where you complete shapes and the area gets filled in. However, if there is an enemy bird within your shape, it will not fill in. I want to make it so that if you do trap a bird within your shape, you will lose a life. How can I write an if statement that pretty much says if the below code doesn't take place...

iPhone: Executing code Just Once at Initiation of Object

Hey everyone, this is an EXTREMELY beginner question, and I'm somewhat ashamed I don't know it already: How can I execute code just once at the implementation of my object? I have an object that's of a subclass of UIView I want some code to be executed as soon as everything kicks off, but I'm only able to get code to be executed in resp...

Store static Content on iPhone?

Hi there, I was wondering what is the best way to store static content for my app. E.g. a list of products (name, photos, price, url). Maybe s.o. can direct to a good tutorial? thanks. ...

nsurlconnecion doesn't return nil even if network is down...

Hi Quite new to network programming and espacially objective-c networking... Even if I shut down the network interface on my computer, or sets my iPhone in flught mode, NSURLConnection won't return nil with the unpleasent surprise that the application dies. I conform to NSURLConnection protocol with all correct callback methods... So...

How to test localized string on simulator?

Hi, I am using NSLocalizedString(); function for my localized strings. Even though i change my preferred language in simulator settings my string still get shown up in English. Can we test the NSLocalizedString(); from simulator? if so how? Can any one guide me through this please? -- Regards, U'suf ...

iPhone: Performances Differences Between NSURLRequestCachePolicy Settings

When using NSURLRequest on the iPhone, what are the real world performance differences between the various NSURLRequestCachePolicy settings? I am specifically interested in the cache policy's effect on the the user's perception of the speed at which UIWebView pages display. I have been using the default NSURLRequestCachePolicy but I th...

HTML-like layout in iPhone application

How do I make a resolution-independent iPhone view controller that can stack it's subviews like the browser stacks HTML elements? Here's an example. One UILabel at the top that could contain 1-6 lines of text; two UIButtons in a row right below the label; the left button could have a short or long title. I want the buttons to appear at...

UITableView + UINavigationController = unrecognized selector sent to instance xxxxxxxx?

Hi, I'm creating an app which uses a UINavigationController (which's view's nib is RootViewController.xib) located in MainWindow.xib, and a UITableView in RootViewController.xib. I have this code: MainWindow.xib's UINavigationController TDAppDelegate.h // // To_DoAppDelegate.h // To Do // // Created by Radek Slupik on 14-02-10. ...

iPhone development on PC

Can anybody shortly describe solutions to start develop for iPhone on PC? ...