iphone

How should I properly format this code?

Hi, I've a small issue here. I am using an if statement with UIAlertView and I have two situations, both result in UIAlertViews. However, in one situation, I want to dismiss just the UIAlertView, the other, I want the UIAlertView to be dismissed and view to return to root view. This code describes is: if([serverOutput isEqualToString:@...

how to handle iframes/frames dom in the iphone uiwebview

in (void) webViewDidFinishLoad: (UIWebView*)webView I inject some javascript to handle the iframes. e.g. stringByEvaluatingJavaScriptFromString: @"try { var document = window.document.getElementsByTagName('iframe')[0].contentWindow.document.getElementsByTagName('frame'); } catch (e) { alert (e.message); }" It t...

Miss a single tap randomly

I have the following code snippets - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; NSUInteger numberTaps = [touch tapCount]; // Tapping if (numberTaps > 0) { // do something } ... The above code basically detects a single tap on a small image (width...

NSURL Out of Scope

Hi, I've an issue with this piece of code: NSURL *url = [[NSURL alloc] initWithString:@"http://authenticate.radonsystems.net/products.xml"]; NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; //Initialize the delegate. XMLParser *parser = [[XMLParser alloc] initXMLParser]; //Set delegate [xmlParser setDelegate:p...

Serialize state data from NSUndoManager on iPhone

I've got undo/redo set up in my iphone app, and now I'm looking at saving state, so when the user exits the app and then starts it up again, everything is in the same state, including the undo/redo stack. I don't see any obvious way to serialize the NSUndoManager. Is there a good way to accomplish this? ...

Core Data iPad/iPhone BLOBS vs File system for 20k PDFs

I'm designing an iPad/iPhone app using core data. The main focus of the app is sorting and viewing up to 20,000 PDFs They are ~200KB each. Typically its best to not store BLOBS in a DB, but for desktop systems I've typically seen it said that if the blobs are < 1 MB then its fine to use the DB. Any considerations I should take into count...

How can I push a new view controller onto a different nav controllers stack and switch to it?

I have a Tab Bar Controller created in Interface Builder Within the Tab Bar are 4 Navigation Controllers. Each controller functions separately and perfectly (yay!) What I need to be able to do is a push a view controller onto a different nav controllers stack and switch the focus onto the appropriate tab bar item (so that the user mov...

Does iPhone support "greying out" inactive controls?

I have a control that goes inactive under some conditions in my iPhone app. I can [setUserInteractionEnabled: NO] on it and it doesn't respond to touches. Its appearance does not change however. Other environments I am familiar with "grey out" inactive controls. I wonder what is the idiomatic way to hint to the user that the control is i...

#import <FTUtils/FTAnimation.h> returns "No such file or directory exists error"

Anyone out there using the FTUtils library for iPhone development? Following the instructions here BUT getting an exception when I: #import <FTUtils/FTAnimation.h> The funny thing is, I can import every other header file BUT this one. Any ideas? ...

Redirect to different site when iPhone/iPod Touch visits?

I'm running Apache2 on Debian 5. I only want it to redirect when someone visits a certain page. Maybe something in JavaScript? ...

App Breaking in main.m - suspected retaining issue?

Hello, my app appears to be breaking in main.m on a line with contents: int retVal = UIApplicationMain(argc, argv, nil, nil); What does that line do, and why could it cause a breakpoint to fail? Is this a memory issue? ...

Core Data (NSFetchedResultsController) displaying one row per section

I have a CoreData application which uses NSFetchedResultsController. NSFetchedResultsController is useful in that it allows me to access the fetched objects more easily etc. but I find that I have problems with the following: I get a crash when I display a single row for each section (irrespective of the number of actual rows present) a...

willSendRequest redirectResponse doesn't work in iPhone SDK2.0

I use the delegate method connection:willSendRequest:redirectResponse: in SDK 2.2, the code like below: - (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse { if(redirectResponse) { if(!self.autoRedirect) { NSLog(@"response will redirect"); ...

How do I get Core Data to create an SQLite DB from my Managed Object Model

I've been strungling with Core Data. I've looked at the examples and documentation but they all seem to copy an existing SQLite DB into the working directory. I've defined my data model and just want Core Data to create a SQLite DB. I then will populate the db im my app. Can anyone show me how? ...

How do you clean Core Data generated models and code from a project?

I'm having an extremely annoying problem with Core Data in the iPhone SDK. I would say in general Core Data for the most part appears easy to use and nice to implement. I have a sqlite database that is being used as a read only reference to pull data elements out for an iPhone app. It would seem there are really mysterious issues relati...

Loading views dynamically

Case 1: I have created View-based sample application and tried execute below code. When I press on "Job List" button it should load another view having "Back Btn" on it. In test function, if I use [self.navigationController pushViewController:jbc animated:YES]; nothing gets loaded, but if I use [self presentModalViewController:jbc...

iPhone SDK Programming - Working with a variable across 2 views

I have what I hope is a fairly simple question about using the value from a variable across 2 views. I’m new to the iPhone SDK platform and the Model/View/Controller methodology. I’ve got background in VB.Net, some Php, but mostly SQL, so this is new ground for me. I’m building an app that has 3 views. For simplicity’s sake, I’ll call t...

I need to refresh the content of a view as soon as I popViewController

ViewA load some data from Coredata, then push to the next viewB. In viewB, there are some function, that will change the content of viewA (meaning viewB change the content of core data). However, when I pop the view back to viewA, my content stay the same as before. How can I fix this? ...

what constitutes the name Kit?

I'm a bit confused with the "kit" thing. I'm a .Net guy moving toward linux and iPhone dev. I'm wondering if Kits are simply something like a dll you reference? or is it when you have a complete framework consisting of many parts? can I call NUnit "TestKit"? ...

sarhan custom font space problem

I am using sarhan custom font . But the space character is not reflecting in to the text. It's just replacing to next character in place of space. Is there any way to fix this issue? ...