cocoa-touch

HowTo initialise MKMapView with a given user location?

Hey, My app knows the current user position (CoreLocation.framework). As soon as the user opens a new MapView his iPhone starts searching for the current position again. Is it possible to skip that or to change the first user position for mkMapView? Edit: Is it possible to overwrite MKMapView and use an other LocationManager? ...

How to autorotate from portrait to landscape mode?

How can I autorotate an image from portrait to landscape mode on the IPhone? ...

NSArray becomes NSCFArray when passed

I have a method that receives many different kinds of objects and decides what to do with them: -(void)performAction:(NSObject *)myAction withItem:(Item *)myItem { actionCount = -1; NSLog(@"-- NEW ACTION ARRAY --"); if ([myAction isMemberOfClass:[Look class]]) { currentActionArray = [self createLookArray:(Look *)myAction item:myItem];...

Iphone devolpement Dynamic Flickr Rss graber

Hi, I am trying to adapt http://kosmaczewski.net/2009/03/08/asynchronous-loading-of-images-in-a-uitableview/ to load a specific flickr feed but at the moment when I put in a flick rss feed in definations.h it wont load the images past the thumbnail view // // Definitions.h // AsyncTable // // Created by Adrian on 3/8/09. // Copyrig...

How to get back all those good old Xcode features?

After I've upgraded to Snow Leopard and Xcode 3.2, everything was screwed up. It took a while for me to figure out the whole evil was that my old Xcode installation was not really "updated", but replaced. So just everything was gone. All SDKs, Settings, everything. So Code Sense did not work because of no SDK available, and all the othe...

Why do these UITableViewCells cause a leak in instruments?

So after a lot of old fashioned comment-out-debugging to narrow down a leak in instruments. The leak occurs when I push a new TableViewController onto the stack. I found that I'm getting a leak from this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellI...

Xcode lost all frameworks after update to Snow Leopard: How to fix that?

For some reason after updating to Snow Leopard, my Xcode 3.2 is stupid like a toast. I had all iPhone SDK's, tons of Gigabytes of data. All is gone to deep toilet. And now I start downloading all that stuff again. Is there maybe some little hope that all those SDK's are still on my mac, somewhere? Where? Or must I really re-download and ...

How to get iPhone SDK 2.2.1 for Xcode 3.2?

After my upgrade to Snow Leopard and Xcode 3.2 (which I really regret a lot!!), Xcode lost all the SDK's. I'm one of those old-fashioned idiots who still want to develop for 2.2.1. But Apple does not offer me an old SDK download. Now I was clever and made tons of time machine backups. But: What's the preferred way to get iPhone SDK 2.2....

Do I have to hook up Xcode 3.2 with my iPhone dev certificate stuff?

I can't do anything right now, because after updating to Snow Leopard my whole development environment is totally screwed up. Do I also have to run through the painfull process of assigning provisioning certificates and all this annoying stuff once again now? It's long time ago I did that, but I slightly remember I had to set up somethin...

Can I disable UIPickerView scroll sound?

Hi, I want to disable the annoying clicks that the UIPickerView generates upon scrolling up and down. Is there a way to do this? I want to play short sounds for each item that the picker view lands upon. It gets ruined by the built in sound. I understand that the picker sounds can be turned off globally by switching off the keyboard so...

What's the maximum memory footprint in MB for an typical iPhone app?

I know this is a subjective question. As far as I know, there are somewhat about 25 MB available for the app, but it depends on what else is going on. Currently playing music, a current phone call or what ever might drop that amount of memory down a lot. I don't know. Just tell us what you think, or what you have experienced. My app cur...

Is there a more performant way of animating an image sequence?

I fear this is evil code: CGRect iRect = CGRectMake(0.0f, 0.0f, 320.0f, 400.0f); UIImageView *imgView = [[UIImageView alloc] initWithFrame:iRect]; imgView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"b0001.png"], [UIImage imageNamed:@"b0002.png"], // 150 more [UIImage imageNamed:@"b0152....

Framework Leaks

When using the Leaks instrument in Instruments, I have a few leaks that occur, but all the participating methods seem to be in Apple frameworks. The specific one's I have been seeing lately are leaks in MapKit. They seem to occur when MapKit is interacting with CoreAnimation. Is there any easy way to tell if these leaks are some how caus...

How can I get the real time in iPhone, not the time set by user in Settings?

Hi, I need to ensure that my app gets the correct time, not the time set by the user in settings. So for instance, once the user starts the app, I'd want to get a timestamp. The user would see the elapsed time on a timer on screen updated every second. When the user exits the app, and after some time restarts the app , the timer wou...

How can I detect whether the iphone has been rebooted since last time app started

Hi, I'd like to detect from within my app whether the iPhone has been rebooted since last time my app was started. I need to do this because my app uses the timer since last system reboot to clock a user's time and I want to detect reboot so I can invalidate the time. Is there anywhere I could extract the information from the system c...

iphone Simulator crashing from Xcode run and go

Does anybody know what might be causing this problem? When I run the code, the program immediately crashes on the simulator before getting anywhere; however if I just go to the simulator and run the program, the changes were loaded and there doesn't seem to be any obvious problems. Or how could I try to pinpoint this problem? [Session ...

iPhone: If user taps a button to load a view, and clicks again fast, they sometimes click a buton that hasn't been drawn yet

Is there some convention I need to follow to avoid this? I thought maybe I needed to move the frame declarations out of my init functions. I thought I could also perhaps avoid this by rendering a transparent overlay until the screen has finished loading, and then remove it. But that seems like a hack. ...

Prerequisite to know before working on cocos2d-iphone or game programmign in general

Ok i am also one of those who are trying to make their first game esp for Iphone but i have no clue from where to start. I never work on such application before (graphics stuff). It's totally different paradigm for me. I google around, and came to know that opengl will be required, then it cam out there is something called cocos2d-iphon...

Handling redirects correctly with NSURLConnection

For the purposes of this, I'm going to pretend the original url is http://host/form and the new url is https://host/form. (Note that before I ship this, both URLs are going to be secure. However, the nonsecure-to-secure seems like a convenient redirect to test this on.) I'm accessing a web API using NSURLConnection that redirects me. Ba...

When to use CALayer on the Mac/iPhone?

I'm slightly confused when to use CALayer on the iPhone or Mac and when not to use it? CoreAnimation works just fine on my UIView based objects without having to use CALayer. When is the appropriate time to dig into this class? ...