iphone

frame size does not change in landscape mode

I have a UINavigationController that can rotate to landscape mode and that it initializes a new UIViewController and pushes it on the stack. On the UIViewController's viewDidLoad I just print the self.view.frame.size. If the Navigation Controller is in Portrait mode, the View Controller will print {320, 460}. However, when the Navigatio...

idleTimerDisabled not working since iPhone 3.0

I have used: [UIApplication sharedApplication].idleTimerDisabled = YES; in a number of Apps developed and running under iPhone OS 2.x and never had any problems with it. They were clock apps so needed to run constantly and ignore the iPhone's idle Timer setting. However, trying to achieve the same with a new App running OS 3.0 (and w...

Adding multiple UIButtons to an UIView

Hi, I've added some buttons to an UIView (via addSubview) programmatically. However, they appear as overlays (so that I always see the last button only). How do I add new buttons below existing buttons? Regards ...

Interface Builder can't see classes in a static library

I have refactored some UIView sub-classes into a static library. However, when using Interface Builder to create view components for a project that uses the static library I find that it is unaware of the library classes. What do I need to do to make the class interfaces visible to Interface Builder? Update: The correct answer refers to...

iPod app stops responding after iPod returns from standby mode

The GUI of my application stops responding after the iPod has been in standby mode. The application I have made is based on the "Utility application" template from the wizard in xcode - but the original application still works after the iPod returns from standby. My application plays music (AudioUnit) and when the iPod enters standby the...

Can iphone send gps coordinates to a website painlessly?

Is there an easy way to design a website to facilitate an iphone user providing gps coordinates to the site? I am wondering if there might be a naming convention for form fields for example, to let the user input in an automated way. I am considering building a location based website and would like to tailor it for iphone (and other m...

Split String at specific line for NSString

Hello ist there a way to split a String for UITableView at a specific line to put the "rest" (the second part of the data) in an own cell NSString *data; CGsize *size = [data sizeOfStringWithFont:[UIFont systemFontOfSize:14] constrainToWidth:280.0]; if the size.height e.g. is greater than 1500 i want to split the string at this li...

A View Controller that can be instantiated both programatically and in IB?

A view controller FooViewController needs to do some initialization when it's created (of itself, not of the managed view - before the view is even loaded). I want to be able to create it in two ways: Programatically, possibly with some arguments: FooViewController *fooViewController = [[[FooViewController alloc] initWithSomeData:da...

Font size in pixels

On an iPhone how do I calculate the size of a character in pixels for a given point size? ...

Clipping within an UIView with some subviews

Hello, I have some buttons in an UIView. My problem is, that they get cut off at the right side of the UIView. How do I prevent this? I've checked already Interface Builders clip property, but it's no solution for this problem. Regards ...

UITabBarController, UINavigationController and autorotate

i have problem with autorotate on iphone i set up in all classes - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } but it is not respond ;/ Sample code is: http://b6.s3.p.quickshareit.com/files/testautorotatec...

iPhone - strange issue with UIScrollView and touches

Hi I have two UIImageView objects inside my view (both 320x480 one above the other). The lower image view is inside a UIScrollView with scrolling and zooming enabled. Now I want to handle touches inside the other image view but it no longer detects any single taps. I can understand that the UIScrollView handles all the touches which I ...

Updating time in iphone sdk

Hi, I'm using the code provided below to display time and date. can anyone help me with atuomatically changing the time by seconds and the date by the day? NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"yyyy-MM-dd"]; NSDateFormatter *timeFormat = [[NSDateFormatter alloc] init]; [timeFormat set...

IPhone application won't launch correctly

So I'm developing and iPhone game right now and everything has been working just fine when I test it on my first gen iPod touch. Last night, I added in some NSUserDefaults stuff to save a few variables for it. I ran it on the simulator a few times and it worked perfectly, but when I built the app and put it on my iPod, all I got when I l...

UINavigationController - same viewController

I have an app where I'm trying to recursively load views. So I have one view (theViewController) that is able to drill down into another view of the same type (theViewController). I have the recursion working fine and the back buttons work just fine. But I'm trying to implement a function that does some work and then unloads the curre...

iPhone SDK: I have memory issues, can anyone help a newbie fix them?

Hello, I have been developing on the iPhone platform for a very short time, and already I've had my fare share of syntax errors, and now memory issues. In my iPhone app an image view is animated multiple times by different buttons(6), and this works well on the iPhone without problems, but when I tested my app with instruments for the f...

CFReadStreamSetClient stops sending events at EOF

I have some code that downloads a file from the internet. Once I have written X bytes of that file to the local file system I tell another class to start reading it. CFReadStreamRef stream = CFReadStreamCreateWithFile(kCFAllocatorDefault, (CFURLRef)url); CFStreamClientContext context = {0, self, NULL, NULL, NULL}; CFReadStreamSetClient...

Transfer Images between iPhone and Web Service

Thanks in advance everyone! Background: I have a WCF web service running that is communicating with an iPhone app over SOAP. The WCF web service method is expecting a byte[]. Problem: Now I need to transfer images to and from the the iPhone app to the web service. I have been manually creating the SOAP request and sending it to t...

C++ code in iPhone app

I'm trying to use a C++ library (CLucene) from my Cocoa Touch iPhone application using Xcode 3.1.3. Everything works fine when I run in the iPhone simulator, but things get strange when I run on device. It seems like pointers aren't being passed correctly from the Objective-C++ code (my app) to the C++ library (CLucene). While debuggin...

Getting started creating custom view transitions.

I'm looking for tutorials on creating custom view transitions. In particular, transitions that involve elements other than just the UIViews being affected, such as playing an animation over the transition as it is happening or modifying a screenshot of the UIView being transitioned out. I don't mean implementing the basic set of transi...