iphone

How to apply text shadow to UITextView?

Actually I love UILabel. They're sweet. Now I had to go to UITextView because UILabel is not aligning text vertically to the top. Damn. One thing I really need is a text shadow. UILabel has it. UITextView seems to not have it. But I guess that guy just uses the same underlying UIKit NSString additions?? Maybe someone already has a soluti...

Does iPhone SDK have a trip duration API?

Does iPhone have a trip duration API or is the only option to use google's getDuration()? Thanks. ...

Core Data NSFetchedResultsController sorting in certain sequence

I'm writing iphone app that has UITableView and uses Core Data. Data in UITableView is shown using NSFetchedResultsController. I use NSPredicate operator "IN" to fetch only needed entries. NSArray *filterArray = [NSArray arrayWithObjects:@"789", @"963", @"445", @"198", nil]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"i...

iPhone / iPod Touch mailto link destroys javascript timers

In mobile safari on iPhone or iPod Touch if a user clicks on a mailto link and then returns to the page (either send or cancel), timers no longer function inside of javascript. I've posted a bug to apple, and on openradar. However, I was wondering if anyone out there has come across this before and come up with some sort of workaround....

Newbie Objective C developer question

I have been looking everywhere for an answer to this question - perhaps I'm looking in the wrong places. Also, I'm brand new to Objective C although I have around 10 years of experience as a developer. for this code: [receiver makeGroup:group, memberOne, memberTwo, memberThree]; what would the method definition look like? - (void)m...

Network errors when initializing NSXMLParser on iPhone

How can I detect and properly report a connection error when executing this line of code: NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:feedUrl]; Is there a clean way to do it or will I have to break this up code up into NSURLRequest, NSURLConnection, etc... ...

UIView Controller mysteriously getting deallocated

I have a UINavigation scheme with a "welcome" page, a middle page, and a detail page. In the middle page, there's a segmented controller that can swap the main body of that page between a table, a calendar, and a MKMapView, each implemented with their own view controller classes. Today I implemented the MapView and its annotations and ...

iPhone OpenGLES textures - colour banding

I've got a problem with openGL on iPhone which I'm sure must have a simple solution! When I load a texture and display it, I get a lot of what I believe is called 'Colour Banding', whereby the colours, particularly on gradients, seem to get automatically 'optimized'. Just to demonstrate that this wasn't anything wrong with my own code...

iPhone. View architecture

Can anyone summarize the relationship between the following items? Content View View Controller Nib the view, subclass of UIView Application delegate I got very confused about these. Coz some people say the "content view" contains the "nib" while other people say "content view" and "nib" are not containing each other. Many thanks! ...

What smartphones to target for a modern b2c app?

We want to build a smartphone app which uses geolocation, etc. and target the most important smartphones. Which OS would you support for a b2c application? I found a german statistic here: http://de.statista.com/statistik/daten/studie/150842/umfrage/prognostizierte-marktanteile-der-smartphone-betriebssysteme-in-2013/ which forecasts the ...

shouldAutorotateToInterfaceOrientation doesn't work on first launch after fresh app install

When the app I'm working on is installed either via Ad-Hoc thru iTunes or built directly to the device, upon launching for the first time, the only view controller in my app that responds to orientation changes doesn't receive calls to shouldAutorotateToInterfaceOrientation: with a landscape argument passed in; debugging shows that it's ...

why does this code leak? (iphone)

This is the header: @interface ForumBrowserAppDelegate : NSObject <UIApplicationDelegate> { ForumSelection *forumSelection; UIWindow *window; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet ForumSelection *forumSelection; (I'm not sure what the nonatomic does, is it something to do w...

Multiple UIWebViewNavigationTypeBackForward not only false but make inferring the actual url impossible

I have a UIWebView and a UITextField for the url. Naturally, I want the textField to always show the current document url. This works fine for urls directly input in the field, but I also have some buttons attached to the view for reload, back, and forward. So I've added all the UIWebViewDelegate methods to my controller, so it can ...

Feteching/Cashing Data From UIWebView

Hi, I was wondering if there is anyway to get what is being displayed in UIWebView. e.g; you have opened bbc.co.uk in UIWebView and you wanted to save all the content of that page, Is there anyway to do that? Thanks. ...

For the iPad or iPhone, how do you control the system Volume? For example, have a button that mutes all audio.

I would like to make a button in my iPad app (probably will be similar to iPhone apps) that when I push this button, all audio is muted, even when you exit the app. I don't see anyway that you can control the volume, although I'm sure other apps have that I have seen in the app store for the iPhone. I also read some places that doing t...

variable parameter function - EXC_BAD_ACCESS when calling [obj release];

I have the following method: (void)makeString:(NSString *)str1,... { va_list strings; NSString *innerText = [[NSString alloc] init]; NSString *tmpStr = [[NSString alloc] init]; if (str1) { va_start(strings, str1); while (tmpStr = va_arg(strings, id)) { innerText = [innerText stringByAppend...

iphone: mechanical drawing & layers

I need to do a bit of mechanical drawing. I can (1) display the part’s image, [self.view addSubview:thePartAsImageView]; (2) implement two sliders (one horizontal for part’s width and one vertical for part’s height), heightSlider.transform = CGAffineTransformRotate(heightSlider.transform, 270.0/180*M_PI); (3) display the correspond...

Return to a removed view controller

Here is the situation, I have a login page as the initial rootView of a tab bar. Once the login process is done, the view is removed from the navigation controller, so you don't navigate back to it. I have places in the app where you can logout. The logout process works fine, but when I try to forward the user back to the initial login v...

Tab bar within Navigation bar

I have a navigation based app, in one of the screen I now want to add a tab bar. Can any one please share code snippet on how I can do that. Thanks ...

UIImagePickerController causing sqlite errors (Simulator only)

When I display a UIImagePickerController in a UIPopoverController the console outputs the following warnings: sqlite error 8 [attempt to write a readonly database] sqlite error 8 [attempt to write a readonly database] sqlite error 8 [attempt to write a readonly database] sqlite error 1 [no such column: duration] sqlite error 1 [no such ...