ios

NSString with XML to NSArray with NSDictionary

Hi, I have a small problem I can't seem to solve. I have a XML page with the following content: <?xml version="1.0" encoding="utf-8"?> <ArrayOfCategory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://api.tradera.com"&gt; <Category Id="1612" Name="Category 1"> <Categ...

What can be passed in (void *)context?

I'm doing some UIView animation stuff using [UIView beginAnimations:nil context:nil]; // ... Animation configuration ... [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(animationEnded:finished:context:)]; [UIView commitAnimations]; Regarding the following question: http://stackoverflow.com/questions/3...

Do simple task in the background after a long time on iOS 4+

How can you have the simplest tast happen after 5-10-60 minutes on iOS? Essentially, have an NSTimer fire after a predefined interval. I do "begin task", sleep( for some time ); and then "end task". However my app usually gets killed if I sleep for more than 5 minutes. I've seen posts around that mention that apps can stay alive in the ...

NSManagedObject retain count is 2 after creation

I'm wondering if someone could explain why the retain count of a newly created managed object is 2. Here is the code I'm working with: NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; Album *newAlbum = [NSEntityDes...

Simultaneous AVCaptureVideoDataOutput and AVCaptureMovieFileOutput

Hi, I need to be able to have AVCaptureVideoDataOutput and AVCaptureMovieFileOutput working at the same time. The below code works, however, the video recording does not. The didFinishRecordingToOutputFileAtURL delegate is called directly after startRecordingToOutputFileURL is called. Now if i remove AVCaptureVideoDataOutput from the AV...

Access User-Defined Setting in Xcode

Hi everyone, If i added a user-defined setting in my build configuration, how can i read that setting in my objective-C files. I have two files in my project debug.plist and release.plist. I want my MainApp.m file to read one of these files based on which build configuration is running. I set up a user-defined setting named "filename" i...

Custom UITableViewCell Removing a subview

Hello stack overflow, So I have a problem and know exactly what is causing it, just not how to fix it. Basically I have a tableViewCell that is loading something like this: BroadcastTableViewCell *cell = (BroadcastTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; /* * Other code to finish cell setup * *...

accessoryButton with Instruments automation

Hi, I'm writing some automation .js file, and I need to tap one of my accessoryButton from one cell. How can I send the tap message to it ? This is a custom cell, but the accessoryButton is added by iOS, not by me, and I don't know wich name it has. Also in the docs I couldn't find anything ... I have the cell referenced correcly as...

Universal app iPhone or iPad

hello all, in my universal app i need to check in the ViewDidLoad if the iDevices is iPad or iPhone is there an method or code ? thanks ...

Convert NSNumber to NSString and use it in other View

So I have an Array "myArray" with NSNumbers and NSStrings. I need them in another View so i go like this: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { DetailViewController *details = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil]; details.subjectText = [[myArray ...

Passing a managedObjectContext through to a UITabBarController's views

I have an app which is based on the Utility template (where you flip over the view to see another). On the first view there is a login screen, then it flips over to reveal a UITabBar style interface. I'm having trouble working out how to pass the managedObjectContext from the App Delegate (where it is created) all the way through to eac...

How to draw on a non-transformed context while zoomed in a CATiledLayer?

I'm using a CATiledLayer for the visualisation of data. By default the drawLayer function gets a transposed and scaled context, which allow the drawing code to be agnostic of the zoom-level and the tile that's being requested. However, I would like to use the zoom functionality to change the horizontal range of the data, without actual z...

install webapp to home screen thought javascript/html

There are tons of posts about installing webapps on the iOS (iPhone, iPad) though Safari, but none of them answers if it can be done though javascript or a html link with specific "rel". The scenario is that I want to user browsing to the web site, to be able to simply click a huge install button in the middle of the screen, then iOS wo...

CoreText: Invalid 'kern' Subtable In CTFont

I am using a custom font applied to a CATextLayer. I am using the tutorial and sample code found here. http://www.freetimestudios.com/2010/09/13/custom-fonts-on-the-ipad-and-ios-4/ However, every so often, I get the following error. Nothing in particular seems to trigger it. Can someone shed some light as to what this means? What to che...

UIView Animaton Resets to beginning

I'm attempting to run an animation so that the scrollview's contentoffset gets continually scrolling down. However, after each repeat, it will animate from the original position and it is not progressing. [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState: YES]; [UIView setAnimationDuration:1.0]; [UIV...

Move UIImageView along the x-axis using a UIGestureRecognizer

Hi. I have four UIImageViews lined up in a row and I want to be able to move the images from left to right. Is there a way to bound the movement to the x-axis (along the image centers) i.e. moving them only left and right? Similar to moving the icons around the screens on an iPhone. I've added a UIPanGestureRecognizer to each of the ...

What is the most efficient way to count number of word in NSString without using regex?

I am a bit new to Objective C and was wondering if there is a better way to count words in a string. ie: NSString *str = @"this is a string"; // return should be 4 words .. The way I now how to do it is by breaking the string into an array of words space (' ') character and count the array. Any advise will be appreciated! Thanks!!...

Instruments automation: iterate for all buttons

Hi, I'm in the process of automate one of my apps. First I tap on a tabBar =>ok Tap on a 'Add' button of a navigation bar => ok Fill some data of my textFields of my tableView => ok Tap on some cell and open a new ViewController => ok Tap on a 'Add' button in this new controller => nothing happens ... The button is the same as the...

Using XML-RPC in iPhone apps

Hello! Is it possible to use XML-RPC calls in iPhone application? For example, only streaming model of xml processing can be used. So we can't use NSXMLDocument in iPhone applications. Are there any similar constraints with XML-RPC? Thank you, Paul ...

IOS UIDatePicker always initialized with actual date and time

Hi, I have a problem with initializing a UIDatePicker within a Popover Controller on iPad. The picker works fine and always returns the correct selected date but when I want to modifiy the date it should display using [datePicker setDate:selectedDate animated:YES]; or datePicker.date = selectedDate; It does not change and always d...