iphone

iPhone Developer's Cookbook: ModalAlert Frozen

I've used a recipe from the iPhone Developer's Cookbook called ModalAlert in order to get some text from a user; however, when the alert is shown, the keyboard and buttons are frozen. Here is the code for the modal alert. +(NSString *) textQueryWith: (NSString *)question prompt: (NSString *)prompt button1: (NSString *)button1 button2:(N...

iPhone Apple Push Notification service

Hi all, When i log in to iPhone developer programmer portal as admin, if go to App Id section i can see list of app id's.I want to enable for push notification.But in Action column there is nothing i am not getting configurable button. So i am not able to proceed further to get SSL certificate for my app. ...

UIButton setBackgroundImage consumes a lot of memory

I'm using the following code: UIImage *buttonImage; if (p.placeImage != nil) { buttonImage = [UIImage imageWithData:p.placeImage]; } else { buttonImage = [UIImage imageNamed:@"bg_place_noimg.png"]; } [imageButton setBackgroundImage:buttonImage forState:UIControlStateNormal]; When executing the app with Instruments I can see ...

Using GameKit to transfer CoreData data between iPhones.

I have an application where I would like to exchange information, managed via Core Data, between two iPhones. Has anyone attempted this and if so what is deemed to be the best approach to doing so (i.e. are people using some intermediate format such as XML or JSON in a file or can the objects be transfered directly). My apologies if t...

AudioFileOpenURL returns -43 on an existing file.

I have a step in my application where a user repeatedly hears three spoken digits. If I leave this step running for a while (for certain undefined values of "while"), my debug logs show this (irrelevant log entries removed): 2010-03-01 13:44:21.283 iPhoneHearChk[1236:207] AudioFileOpenURL returned 0 (for <file://localhost/var/mobile/A...

iphone: applicationWillTerminate not called during a NSURLRequest?

Hi, I am working on an application where the user at some point must wait for a proper response from a webservice. This might take some time, because it requires a manual confirmation from the webservice. Because of this, the timeoutInterval on the request is set very high to prevent it from terminating too early. The problem comes w...

Any other way to do animations?

Is there any other way to do animations besides my below code? I'm asking because I'm going to have some pretty intense animations that could get up to 20-30 frames. I'm also wondering if it's possible to play a sound with each frame? popup.animationImages = [NSArray arrayWithObjects: [UIImage imageNam...

UIPickerView row selection

Hey, I have a UIPickerView with two components. It works fine when the user scrolls each component until it reaches the desired value. But I want it to behave like the picker in the calendar or the clock apps. Meaning: When the user presses a certain value in one of the components, I want that component to automatically turn that row to...

Admob in iPhone with Tabbar and TableView

I'm having tab bar with 5 buttons. Out of 5 tabs, 2 are table views which uses navigation controller for showing sub views on click of cell. Above the tab bar, in each view I left some space for ads using "Admob". I'm adding ads using IB. But its giving EXC_BAD_ACCESS when its reaching "adMobAd = [AdMobView requestAdWithDelegate:self];" ...

EXC_BAD_ACCESS when calling pushViewController

Hi I have a UITableView inside a UITabBarController. When I'm calling [[self navigationController] pushViewController:myViewController animated:YES]; there is no problem. but, When I'm calling the same line from inside a UIActionSheetDelegate, for example: - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NS...

How to force coredata to rebuild sqlite database model?

Hello, In my app I sometimes need to rebuild and repopulate database file. SQLite databse is created and managed by CoreData stack. What I'm trying to do is drop the file and then simply recreate persistentStoreCoordinator object. It works under simulator but not on device, where I'm getting such an error: NSFilePath = "/var/mobile/A...

iPhone performance optimization best practices

I was looking for a book, text, post or something talking about iPhone optimization but I couldn't find anything except for Apple documentation. I think it would be great to talk about which are the common steps you do when optimizing your apps performance. I'm now trying to improve my app memory usage and I've figured out it is really ...

How can I handle control resizing when rotating screen

Whilst 90% of my controls resize perfectly with the snapping features. I have some elements which are sized programmatically due to their contents (i.e a label and its container) in the ViewDidLoad function. Is there anyway to get a handle on the screen rotation event? So I can perform my control resizing manually? Thanks ...

Do I need release in the dealloc?

In the book I'm studying from for iPhone dev, they utilize IBOutlet instances using the Interface Builder. An example would be a UIButton. So they add a thing in the struct like this: IBOutlet UIButton *whateverButton; Then they add a @property for each of these in the .h, and a @synthesize in the .m. Then they include a release in ...

How to convert an NSArray of NSManagedObjects to NSData

Hi, I'm new to Objective C and was wondering if anyone can help me. I am using core data with a sqlite database to hold simple profile objects which have a name and a score attribute (both of which are of type NSString). What I want to do is fetch the profiles and store them in an NSData object, please see my code below: ...

How to change the baseline of an UITextField ?

How would you change the baseline of any text entered in a UITextField? ...

How to replace a UINavigationBar with a UISearchBar?

Does anybody know an example code of a UISearchBar which appears in place of the UINavigationBar in response to a search button tap on the navigation bar? I have seen it in the Advanced English Dictionary App. (saves the vertical space and does not scroll with the table). http://itunes.apple.com/de/app/advanced-english-dictionary/id293...

Customising a TableView - iPhone

I am trying to customise a TableView in my iPhone application. I have found many tutorials that do this but they are all for version 3.0+. I want to make my application as generic as possible so I can get it to work on as many iPhones/iTouches as possible. Is it possible to create a customised TableView for 2.2.1 to 3? I've found not...

UINavigationController setViewControllers makes application crash

I'm having a strange issue and I don't know if it is my bug (most probably) or a bug in UINavigationController. I use UINavigationController in my application. In some cases I need complicated navigations like "pop 2 screens and push new one". Currently I do it by getting current navigationController.viewControllers, modifying the colle...

iPhone Horizontal NavBar Height ?

Can someone tell me the pixel height of the iPhone navBar, when you turn the phone Horizontal? I know this is a basic question but I cannot locate the answer. Thank You. ...