iphone

PhotoLibrary/Camera does not activate on in iPhone app

I've this method for opening the photoLibrary/camera in my view controller. But nothing happens when I call it (both simulator and device). I've implemented the delegate methods. No errors/warnings. I'm missing something? - (IBAction) doButton { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.del...

Wired NSDictionary problem...

Hello, i have the following code : NSDictionary *dict =[[NSDictionary alloc]initWithObjectsAndKeys:myarray1,@"array1",myarray2,@"array2",nil]; NSArray *shorts=[[dict allKeys]sortedArrayUsingSelector:@selector(compare:)]; for(NSString *dir in shorts){ NSArray *tempArr=[dict objectForKey:dir]; for(NSString ...

iPhone: Cloud data sync loading screen not working.

In the view of my application, I have a subview that says "loading," and appears while cloud data is being synced. In viewdidload, I have // Reachability test. BOOL isConnected = [self checkInternet]; // If we have connectivity, then sync data with cloud. if(isConnected){ [self beginDataSync]; }else{ [self hideLoadingView]; ...

i should able to delay 2 sec using nstimer how to do it?

i want to produce the delay of 2 sec using nstimer how to initialise timer in program?.... ...

Large UIImage drawinrect extremely slow on selection

I have a custom UITableView cell that sports an Image, and a headline. I used the fast scrolling example of ABTableViewCell from atebits. It seems when I select the first row (which is my row with the largest image) it takes a considerable amoun of time to highlight the row, and then push the new view controller. However when I select ...

Change the UITableView separatorColor for a single UITableViewCell

I have a UITableView that uses a variety of custom UITableViewCells. I'd like to be able to have one of these table cells appear with a different separator color than the rest of the other cells. I know that tableview.seperatorColor updates the whole tableView. Is there a cell specific property I missing or another approach to doing th...

UITableView and the alertView: clickedButtonAtIndex method

I am playing around with xCode and was trying to create a small app that comprises of a table view (built using an array) comprising the names of various individuals. The user would be able to click on one of the rows in the table view and would be shown a UIAlert with an option to call the person or cancel. If they click on cancel, the...

Calculating line breaks every N characters?

I'm making an RSS parser for iPhone and iPod Touch and I need to be able to set the number of lines shown in each cell for each article. I'd like to break every 39 characters, which is the most that fits on a line at the font size that I'm using. I'd like to take the number of characters in a string and divide it by the number of charac...

how to restore view to view did load

i am using a view that displays multiple items depending on user input and i would like to when i press a button to be able to go back to the first view generated in the view (viewDidLoad). I tried numerius methods such as adding an action to a selector to load a -(void) that reloads the view however that crashes too. I havent been abl...

How to read XML data which is stored in array.

I have a response from Web Service (XML response) in NSArray which is like: Table Name John Name Address Atl /Address /Table Now I want to display only Name from this array in my table view. How to do this? I tried with NSDictionary but I am getting some errors. Someone with good idea how to do it? ...

Refresh view controller content on app entering foreground

I have an app with a tab bar that has a few tabs with user-generated content. When each view controller loads, the viewDidLoad method makes HTTP requests to a server to fetch data, then populates its view correspondingly. Once all the data is loaded, however, the view remains the same (unless the view controller is unloaded and reloaded)...

arc4random help

is there any simple tutorial or help available to getting to learn how to use arc4random to select a random set of numbers? ...

UIGestureRecognizer blocking buttons in table cell views

Hi, I am using a custom UIGestureRecognizer on a UITableView. As soon as I add the GestureRecognizer to the view, the buttons inside my table cells stop working (although changing the visible state to pressed, no action is being called). And I am using [self setCancelsTouchesInView:NO]; and no recognizer chaining or what-so-ever. Any...

Is it possible to use HTML in web form that uses UIDatePickerView when viewed on iOS?

I want to present an HTML-based form in a UIWebView with a date field. I want the OS to recognize this as a date and show the UIDatePickerView for entering the date similar to the way it presents a UIPickerView when entering data in a form select field. Is this possible? ...

iPhone App Receive Headset Button Presses While in Background

Is it possible for an iPhone app to receive headset button press events while in the background? Assuming this is an app with an UIBackgroundModes of audio. ...

Getting nil from standardUserDefaults,.

I have created a Settings.bundle for my application, and I try to read the settings by the following code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if(!defaults) { NSLog("can not get default bundle"); } NSString *usr = [NSString stringWithFormat:@"%@",[defaults stringForKey:@"username"]]; NSLog(usr); The o...

Memory Management example

Here is some of the code from one of my classes, I was wondering am I handling the memory right or am I leaking anywhere? @implementation CardViewController @synthesize playerImage; @synthesize cardLabel; @synthesize card; @synthesize frontView; @synthesize backView; @synthesize nameLabel; @synthesize infoLabel; @synthesize delegate; -...

Multitasking and termination

Is there any possiblity for reacting to the event that a user kills your app via the multitasking bar if it has moved to the background? According to my observations, applicationWillTerminate: does NOT get called. It seems to me that there is no possiblity for cleaning up before quitting in this case. ...

Tracking down iOS memory spikes

I have an iOS 3.2 program running on the iPad that is document-centric. Sometimes, when closing a document, there is a memory spike in Instruments. I'm pretty sure I'm not leaking memory, since the allocations graph stays pretty steady between 5mb and 10mb, except when closing, where it spikes up by about 5mb or so (and the leaks tool is...

How to hide one of the two Right buttons in the navigation bar

Dear all I have implemented two buttons in the navigation bar on the right side on top of a text view as; UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 112, 44.5)]; // toolbar style is the default style // create an array for the buttons NSMutableArray* buttons = [[NSMutableArray alloc] ...