cocoa-touch

Downloading a file from url and saving to resources on iPhone

Is it possible to download a file (i.e. an sqlite database file) from the Internet into your iPhone application problematically for later use within the application? I am trying using NSURlConnection, but not able to save the file. Here is the example code I am trying: - (void)viewDidLoad { [super viewDidLoad]; NSString *...

Core Data model design — search vs relationships?

I'm familiar with Core Data basics and have done some dabbling, but have not really done any major apps. Now I need to plan for one. And the question is not specifically about Core Data, but more about data design in general, though I am going to use Core Data to implement it on iPhone which is important for considering performance. Ima...

Alternative to NSSetUncaughtExceptionHandler on iPhone

I'm trying to make a general error handler for an iPhone app that brings the user to a recovery screen whenever any general error is thrown in the application without putting a try/catch block around every single method in the application. Using NSSetUncaughtExceptionHandler doesn't work because the application terminates after the hand...

Iphone Core Image Filter

Hi All, I'm wondering about that, i have seen into many sites describing that Core Image filters on Iphone doesn't support by Apple. But i have seen Core image filter in Core Animation example page on the Apple developer site. just look at here Iphone OS Refference Library, you will see that example on this page CIFilter *filter = [CI...

How can I write to the current directory in the iPhone SDK when running xcodebuild from the command line?

Hi folks. Does anyone know how to obtain the path to the current directory when running xcodebuild (mainly, the project directory) and write files to it? I'm trying to save the results of some unit tests to disk from my obj-c code, but I'd rather not dump them deep in the app's document path if possible. I might be able to append '../../...

Spacing between characters on the iPhone

I have a label and I wish to increase the spacing between characters. I tried adding a space between each character, but this was too much Perhaps there is a font with large spacing between the letters? If all else fails, I am considering putting each character (only a size character code), into its own textbox. Any ideas on how to ...

Bluetooth Transfer for Core Data Entities

How would I go about using bluetooth to transfer a core data entity with it's corresponding relationships? I have three core data entities with inverse relationships set up and it all works fine, but I need to transfer these to another iPhone based on the context that it is not in the corresponding table in the core data entity set on th...

UITableView didSelectRowAtIndexPath: not being called on first tap

I'm having an issue with UITableView's didSelectRowAtIndexPath. My table is setup so that when I select row it initializes a new view controller and pushes it. The first time I tap any row in the table, the method does not get called. Once I select another row, it begins to work as normal. I have verified this by setting a breakpoint ...

Centering map against user's location

I'd like to center a map (mapkit) against the user's location. I do the following in the simulator but only get a blue map with no content. What steps should I be taking? MKCoordinateRegion region; MKCoordinateSpan span; span.latitudeDelta=0.2; span.longitudeDelta=0.2; CLLocationCoordinate2D location; location.latitude = mapView.user...

How to handle '&' in URL sent as HTML from iPhone Mail.app

Apologies if this has been answered already. There are similar topics but none that I could find pertaining to Cocoa & NSStrings... I'm constructing a clickable URL to embed in an HTML email to be sent via the MFMailComposeViewController on the iPhone. i create the url then use stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncod...

UIWindows or UIViews

I need three different sections in my app: a login screen, a main screen, and one that takes place in landscape mode, all totally different. I saw Apple insists that an app should have one window, so I'm asking: what would be best to use for this? Three big windows, or views? And how should the hierarchy look like? I don't have experienc...

problem with NSInputStream on real iPhone

Hi guys, I have a problem with NSInputStream. Here is my code: case NSStreamEventHasBytesAvailable: printf("BYTE AVAILABLE\n"); int len = 0; NSMutableData *data = [[NSMutableData alloc] init]; uint8_t buffer[32768]; if(stream == iStream) { printf("Receiving...\n"); ...

Hiding just one navigationBar in navigationController stack

I am trying to get the same functionality as contacts app in iphone. The problem is following , when i hide navigationbar using following command [self.navigationController setNavigationBarHidden:YES animated:YES] It gets hidden throughout all viewControllers in navigationController stack. I am implementing search in my application pr...

Is a path in the Url Loading System of Cocoa always an URL, or sometimes an URI?

I don't get it: An URL is something that really "locates" a ressource, i.e. it holds enough information to say "man, go here, then there, and you have it!" ...while an URI can say "the file is called foobar.foo ... have fun finding it!" Or am I wrong? Can the URL loading system handle URI's? How would that look in example? For me it doe...

How do I push a new controller via UIButton, nested in a UIScrollView?

Hello - I have my views that are part of a tabBar. Each view has a navigationController. In one of my views I have an embeded xib component. This is a scrolling view with UIButtons inside it. I want to slide in another view, inside the navigationController when a person taps the button. I can get the taps, etc. BUT, I can't figure o...

iPhone UISlider action method

In the current book I am reading, the author implements an IBAction for a slider in the following way (see below V001). To my eye, it seemed a little over complicated so I re-factored the code (V002). Am I right in thinking that sender is a pointer to the object that fired the event? Also, is there any downside to casting sender in the h...

NSOperation blocks UI painting?

Hi, I'm after some advice on the use of NSOperation and drawing: I have a main thread create my NSOperation subclass, which then adds it to an NSOperationQueue. My NSOperation does some heavy processing, it is intended to loop in its main() method for several minutes, constantly processing some work, but for now I just have a while() ...

Problem FBConnect (IPHONE), code not run on didLoad

Hi all, Three days ago this code worked...:( The label will not update to show the loaded facebook username. //Interface .h IBOutlet UILabel *namefb; ... @property(nonatomic, retain)UILabel *namefb; //Implementation .m - (void)request:(FBRequest*)request didLoad:(id)result { NSArray* users = result; NSDictionary* u...

Cast sender to sender object type?

In the code below, do I need to cast sender to UISlider? I can't really see the reason as sender is a UISlider object anyways? -(IBAction)sliderChangeGoat:(id)sender { UISlider *slider = sender; // OR UISlider *slider = (UISlider*)sender; NSString *newText = [[NSString alloc] initWithFormat:@"%d", (int)[slider value]]; [slid...

How to create a full-screen modal status display on iPhone?

I'm trying to create a modal status indicator display for an iPhone app, and would like one similar to this one used in Tweetie: Specifically, this one "shades out" the entire screen, including the toolbar. I don't believe through any normal UIView manipulation, I can extend past the bounds of my window, can I? I believe I've seen a s...