iphone

UITableView footerView with button, button doesn't work

Hi there. I'm trying to create a custom view for my UITableView footerView that has a button in it. I can see it there, but when I touch it, nothing happens... can you see what's wrong here: - (void)viewDidLoad { [super viewDidLoad]; if(self.tableView.tableFooterView == nil) { //allocate the view if it doesn't exist y...

How do I popViewControllerAnimated after a delay?

I have a UITableViewController that is presented with a list of choices. After the user taps one, I'd like to return to the previous view. The return seems too quick with the code I'm using though. I'd like to pause for 0.2 seconds or so to give the user time to see their selection become checked. Here's the code I'm using now: - (void)...

iPad - topmost modal view controller won't dismiss when there are multiple

I'm working on a dual-iPad/iPhone application. I'm having a problem that is occurring on the iPad only: Root view controller is a UISplitViewController on iPad, UITabBarController on iPhone A modal UIViewController can appear over the root controller A modal UIViewController can appear over the previous modal controller On iPad, modal...

Why does my iPhone application crash when it receives a memory warning?

This is sort of a mystery to me. My application does not use very much memory but if I put it in the background and run as many memory-intensive applications as I can, occasionally my application will crash when I try to wake it up. I've looked at the crash log and this is what I see: 0 libobjc.A.dylib 0x000027da ...

game in an iphone: where to start

Hello, I'd like to develop a 2d game that's not gonna be very intensive with an iphone sdk. I don't want to use opengl and i don't want to use ano 3rd party things. So as i understand, i'll have to use a view's drawrect method to draw things. I've spent hours researching this topic and as always with apple's production - it just left me...

How do I build a game that only supports Game Center if it's available on the iPhone?

I'm about to begin building an iPhone game that will make use of Game Center Achievements and high scores, but I'd also like to have a version that works on iPhones that don't have Game Center (i.e. iOS version < 4.1). Can I have two versions of the same app in the app store, one for game center, one for without? Or should I design the...

What exactly is NSBundle useful for - only to access resources of the .app package?

...or could I also get an NSBundle that represents the Documents directory, to easily access contents in there? ...

Place Images out of NSMutableArray on UIView?

Hi, I have an array of multiple images which I want to display on my screen (2 Columns, 4 Rows). If there are more than 8 Images in the row, than a new view should be created. Can someone please point me in the correct direction how to handle this? Thanks for any feedback! BR, Stefan ...

cocoa UIImageView addTarget with extra parameter

With a loop I add UIImageView to a UIScrollView i need to add an extra parameter addTarget so when i click i can log the index. [imageButton addTarget:self action:@selector(buttonPushed:) forControlEvents:UIControlEventTouchUpInside]; -(IBaction) buttonPushed: (int) index { NSLog(@"%d",index); } How do i achieve this? ...

Passing objects into NSOperation and ensuring correct memory management policies

If I want to pass an object that was created on the main thread onto an NSOperation object, what's the standard way of doing to so that I'm not creating any memory management issues? Should I make my object's properties not have the 'nonatomic' attribute? Right now, I allocate the objects via [[[AClass alloc] init] autorelease], keep a ...

In IPhone(Objective C) how do I get the current date formatted in miliseconds to send to a server Rest Web Service?

Hi, I am new to IPhone development. I need to take the current date from device and send to a server in JSon format. The server expects this date to be in milliseconds as since January 1, 1970, 00:00:00 GMT(Unix time) . I have noticed IPhone has some methods to get the current time in SECONDS, well, should be very easy to transform se...

How to turn NSArray of NSDictionarys into a nested NSArray of NSDictionarys

If I have an NSArray (or mutable array) with several dictionary objects (each dictionary is a Person) like this: [ { forename: chris, surname: smith, age: 22 } { forename: paul, surname: smith, age: 24 } { forename: dave, surname: jones, age: 21 } { forename: alan, surname: jones, age: 26 } { forename: cecil, surname: reeves, ...

Facebook photos.upload crash in Facebook Api

Hi to everybody. I need to upload photo on Facebook. But it seems to be impossible. I always have the same crash in console [UIImage dataUsingEncoding:] The way I get my Image: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ [self dismissModalViewControllerAnimated:YE...

Inactive UIBarButtonItem

Hi there Does someone know how the inactive done button in the Contacts App is done? I would like to implement something similar. So far I didn't saw any inactive property on UIBarButtonItem... ...

Assertion and exception on iPad simulator but not iPhone sim or device!

So I've been working on getting my app ready for iOS 4 and iPhone 4. Installed the latest Xcode and SDK and have been tweaking out graphics, etc. All is working flawlessly except I'm having problems running the app on the iPad simulator. I don't have an actual iPad to test. My app uses an ABUnknownPersonViewController and it crashes whe...

Reloading UIImageView Image in a UIScrollView

Hi guys, First some background: I'm using a UIScrollView to make an image visible and zoomable and everything works fine initially, I can view and zoom the image just fine. I'm using a UINavigationController to manage all of my various custom view controllers. After the image is displayed, and the back button is clicked, this view contr...

How can I save the content of a UITextView?

Hey, in my app I want to save the text that was typed in in a UITextView. How can I do this? Thanks for you help. Leon ...

Delete a sub string given a NSRange

Given a String and a Range is there any easy method to get a substring by removing the characters from String which come in the passed Range? ...

iPhone - Table/Grid Data

For an iPhone app, I'm going to need to display read-only tabular data in a grid format. This data could potentially have many rows and columns. I could use UITableView, but the problem is the data will most likely be very wide and require scrolling. Is there a way to put a UITableView in a UIScrollView and allow zooming and scolling ...

UISearchBar No Background Landscape Mode

I have the following snippet to remove the background from a UISearchBar: for (UIView *subview in self.searchDisplayController.searchBar.subviews) { if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) { [subview removeFromSuperview]; break; } } However, if the device is rotated to lan...