cocoa-touch

didAccelerate doesn't fire???

I can't get didAccelerate to trigger. I have the delegate implemented in my header file. I've set a breakpoint in the method: - (void) accelerometer: (UIAccelerometer *)accelerometer didAccelerate: (UIAcceleration *)acceleration { int i = 0; } I've tried it with two different apps but still nothing. Any ideas on what I'm doing ...

EXC_BAD_ACCESS in didAccelerate on phone move

I'm doing the following: - (void) accelerometer: (UIAccelerometer *)accelerometer didAccelerate: (UIAcceleration *)acceleration { if (self.lastAcceleration) { double i = self.lastAcceleration.x; It works fine until I actually tilt the phone. Then I get EXC_BAD_ACCESS on the last line. lastAcceleration is a property with a retain. ...

Method to Display Cell Again in UITableViewController

Which method should I use in order to display a cell again in a UITableViewController? ...

Core Data: multiple entities related to a single entity

I have an entity called 'SyncInfo' (including a UUID and a modified date) that I want other entities in my data model to have an instance of (i.e. employee/department). Is there a simple way to get Core Data to allow me to do this without requiring that SyncInfo have relationships with every single one of the other entities in the data ...

Cocoa-Touch: performSelectorOnMainThread: weird behavior + crash

I have a situation where I'm lazy loading images from the www. It's a list of items, when one item is tapped, a detail view is pushed to a nav controller. In that detail view the item has an image, which first is a default image, and I want to start loading it's image from a URL. So what I do is create an object which once initialized ...

Is there a 1-to-1 ratio of motionBegan and motionEnded events?

I'm implementing shake gestures as described in this answer however if I shake my phone for longer than a second, motionEnded doesn't get called. Is there not a 1-to-1 ratio of motionBegan and motionEnded events guaranteed by the OS, or is this a problem with the responder chain and events are getting sent elsewhere? ...

Word wrap not happening in UITextView

I'm doing something that requires storing some text entered in a UITextView. It all works fine until the text is restored, then it is not wrapped in the UITextView (like it did when it was entered) but is truncated (just like a UITableViewCell does by default, tail truncation). Once the text is in the UITextView, it is saved to a Core D...

An IBOulet for an NSArray size in a Non-Controller Class

I have a class along the lines of: @interface Foo : NSObject { NSMutableArray *bar; } Foo isn't a controller -- it's responsible for some other logic that I want encapsulated. I'd like to have a label display the size of bar. If it was a value in a controller, I could simply make it an IBOutlet, connect it in IB, and everythin...

calling an application from other application

hello, I am writing an application in Objective-C whose functionality is to call and execute another application.Pls can i know the procedure???Let me also know where i need to keep the calling application which has to load and execute??? ...

iphone writeTofile error

im getting a "CFDictionaryAddValue(): immutable collection 0xd5aea0 given to mutating function" error when i try to write a string to a file using the follwowing code NSString *xmlString = [NSString stringWithString:xmlData]; NSError *error = nil; if ([xmlString writeToFile:filePath atomically:NO encoding:NSASCIIStringEncoding error:&e...

Sqlite - "incomprehensible archive" problem

Hi! I am working on a iphone/Ipod touch project involving saving and fetching data from an sqlite database. It is working fine, but at some points in development i get this error (when the app starts): erminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSKeyedUnarchiver initForReadingWithData:]: inco...

Core Data / Cocoa : @distinctUnionOfObjects not returning a usable NSArray*

Hi there, I have an application that uses Core Data that has a relationship that I would like to group by. I have NSManagedObject classes that were generated by my .xcdatamodel file, and everything seems to be working OK for the most part. Given a parent / child relationship, I would like to do the following: A parent has a collection ...

Problem with NSStream SSL Connection

Hi all, I am using NSStream with SSL property for socket connection. It works fine when I use the local IP address such as 192.168.1.77. But if I use any server like www.xyz.com (it has SecurityLevelTLSv1), it shows an error error code:-9843, Message:Operation could not be completed. (NSUnknownErrorDomain error -9843.) Here is my code: ...

Cocoa-Touch: issue looping MPMoviePlayerController

I have an app which has to load some data at startup, so I want to display a splash-screen animation. I'm using the MPMoviePlayerController to play a m4v file. The movie has it's background set to [UIColor clearColor]. Default.png is the movies first frame, and also the initial views background image (as a UIImageView). To loop the mov...

initWithNibName VS NSBundle's loadViewNamed

I've noticed that there are two different ways to load nib files: 1) via the UIView's initWithNibName:bundle: method and 2) NSBundle's loadNibNamed:owner:options: method. Can someone explain the differences between these two and when it is more appropriate to use one over the other and in what circumstances? For instance, if I'm loading...

Can you trigger functions on the iPhone when the user adjusts the ringer volume?

I would like to bring up the Camera in my app, and let the user take a photo by pressing the hardware volume buttons on the phone. Is this possible? Can I trigger a function when the users changes the volume, and can I then programatically trigger the camera in this function? A link or code snippet would be much appreciated. ...

Getting started with libpurple

I'm writing a Cocoa Touch program that will (hopefully) use Libpurple as it's background. The only problem is that I have no clue where to get started. I've been looking through some source code of applications that do use it, but so far haven't gotten anywhere. Does anyone know anything that will help me familiarize myself with libpurp...

How to make a UINavigationBar "thin"?

In certain places such as Mail.app, the top navigation bar is thinner in landscape mode than in portrait mode. Does anyone know how I could get something like this in my own app? ...

Writing a masked image to disk as a PNG file

Basically I'm downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I'm using the masking code everyone seems to point at which can be found here: http://iphonedevelopertips.com/cocoa/how-to-mask-an-image.html What happens though, is that the image displays fine, but the version...

how does one make a subview firstResponder

i am trying to get a subview to become firstResponder. my understanding is that this is done in its viewDidAppear method, like so: - (void)viewDidAppear { [self becomeFirstResponder]; } while overriding canBecomeFirstResponder to return YES: - (BOOL)canBecomeFirstResponder { return YES; } however, when i insert the subview ...