iphone

best practice to obtain time zone for iPhone vs iPod Touch

I am creating an app that requires the users current time zone. If the device being used is an iPhone and the user has their Time Zone set to automatically change, I think I can be fairly confident that localTimeZone or systemTimezone will give me the correct time zone for the user's location. If on the other hand the device is an iPod ...

How does one populate the results of an UIImagePicker with some "default" images (if the user has none of their own to choose from)

How does one populate the results of an UIImagePickerController with some "default" images. In this case I have made a photo manipulation app where the user selects an image from their library, but I'd like to give them sample images without actually saving them to their libraries. Is there some way to manually inject my default images i...

Button with Tag

How do I get a button with the a specifyed tag id like to then cast it to a UIButton, and change the alpha ...

iPhone Game Having a statement checked every 50 points

Hello! I've run into a little hurdle and wanted to see if somebody could help me! I want to write an algorithm for an if statement that says: if (for every 50 points) { //do something } I thought += 50 would do the trick, but nope. Any ideas? Thanks! ...

Embedding Private Framework into iPhone app

Hi All, I am trying to use some external Framework in my iPhone app. I did the following: copied the xxx.framework inside my project folder dragged the xxx.framework folder to Frameworks folder in xcode clicked add to target and set the path to relative to the project passed -ObjC flag in other flags (required by the framework) when...

Generate non-repeating, no sequential numbers

how does one use code to do this: produce 15 random numbers [EDIT: from 1 - 15] that are not in any order, and that only occur once eg. 1 4, 2, 5, 3, 6, 8, 7, 9, 10, 13, 12, 15, 14, 11 rand() or arc4rand() can repeat some, which is not what im after. Thanks ...

Iphone SDK, arc4random CGPointmake?

I have tried using integers to store the number like so: playPin = 35 + arc4random() % 118; playY = -50 - arc4random() %100; if (CGRectIntersectsRect(pin.frame, refreshpin.frame)){ pin.center = CGPointMake(playPin, playY); pinend.center = CGPointMake(pin.center.x, pin.center.y+58); } Then using them, when needed, but... its random t...

Upload image thumbnail dynamically in background thread iphone

Hi All, I want to upload thumbnail in my table view dynamically. I am not getting the images in a proper way as App Store's App Table does. How to do that? Thanks in advance ...

iPhone: AppStore InAppPurchase Connects in Simulator but Not on Device

I am having trouble connecting to the AppStore from within my application. Everything runs fine in the Simulator but when I run on device the app cannot connect to the Appstore. Here is the code that connects to the Appstore #import "BuyController.h"#import "InAppPurchaseManager.h" #import "SKProducts.h" #define kInAppPurchaseProUpgrad...

How to use NSMutableDictionary to store and retrieve data

I have created Window Based application and tab bar controller as root controller. My objective is to store Text Field data values in one tab bar VC and will be accessible and editable by other VC and also retrievable when application start. I am looking to use NSMutableDictionary class in AppDelegate so that I can access stored Data Va...

UITableView performance difference between Iphone 3G and 3GS ?

Hey guys, I managed to put my new app on an adhoc distribution but I just noticed that I only have 3GS's ... It is working quite good on the 3GS (could be a bit faster but that's fine) ... but do you think I should test it on the 3G ? I know there has been a lot of improvements between 3G and 3GS but would that infer on my uitablevie...

Reading email address from contacts fails with weird memory issue - Solved

Hi all, I'm stumped. I'm trying to get a list of all the email address a person has. I'm using the ABPeoplePickerNavigationController to select the person, which all seems fine. I'm setting my ABRecordRef personDealingWith; from the person argument to - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)pe...

getting data from tableviewcell to 2nd view

I am very new to this and am trying to learn by creating a few little apps for myself. I have a navigation-based app where the user taps the row to select a film title - i then want the second view to show details of the film. Thanks to a very helpful person here i am getting the results of the row pressed as 'rowTitle' as follows : (...

Equivalent of CGPoint with integers?

Cheers, I like strict typing in C. Therefore, I don't want to store a 2D vector of floats if I specifically need integers. Is there an Apple-provided equivalent of CGPoint which stores data as integers? I've implemented my type Vector2i and its companion function Vector2iMake() à la CGPoint, but something deep in me screams that Apple ...

dismissModalViewControllerAnimated makes my app crash :(

I'm creating an iPad app, and I have two classes: NWRootViewController : UITableViewController and UINewFeedViewController : UIViewController. In NWRootViewController I have an UIBarButtonItem, which, when tapped, pops up a modal view controller called NWNewFeedViewController: // THIS CODE IS IN NWROOTVIEWCONTROLLER.M // New Feed -(IBAc...

In short, how is NSFetchedResultsController used?

I'm reading now since one hour through the documentation and still don't get the point of NSFetchedResultsController. Is it a replacement for UITableViewController? Or is the UITableViewController using the NSFetchedResultsController? Is the NSFetchedResultsController the data source? What is it? ...

UIScrollView notifications

Hi, I'm coding an app that works much like Apple's Weather.app: There's a UIPageControl at the bottom and a UIScrollView in the middle of the screen. In my code, I implemented the - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView method to figure out when the user did move to a new page. If they move to a new page, I load ...

Will Apple reject my app if I do not do this?

From the documentation of UITableView / UITableViewController: If you decide to use a UIViewController subclass rather than a subclass of UITableViewController to manage a table view, you should perform a couple of the tasks mentioned above to conform to the human-interface guidelines. To clear any selection in th...

call the function(InApp Purchase)

how can we call the defined function on button action in objective-c on iPhone. for example: we define the function as follow -(void)abc { // } now how can i call this function on the button action ...

button inside table view cell shows highlighted state on tapping on cell

Hi there! I have an issue with the background image of button which is dependent of button state. I have a button inside customized table view cell and i have set different images for button's different states. Please look into the code below. [btnNow setImage:[UIImage imageNamed:@"now_norm.png"] forState:UIControlStateNormal]; [btnNow...