objective-c

UIControlEventTouchDragExit only fires ~100 pixels out

Im trying to "get" when a finger/touch leaves a UIButton in objective C for iphone. I was told in another answer to use UIControlEventTouchDragExit however this event only fires when the touch gets about 100 pixels away from the button, whereas I would like it to be immediate. The apple docs say that goes according to the bounds however ...

What's the correct way to stop a background process on Mac OS X?

I have an application with 2 components: a desktop application that users interact with, and a background process that can be enabled from the desktop application. Once the background process is enabled, it will run as a user launch agent independently of the desktop app. However, what I'm wondering is what to do when the user disables...

Catching multiple keystrokes simultaneously in Cocoa

I have used 4 NSButtons and assigned them to the 4 arrow keys separately to move in four different directions. Now I want to use two keystrokes, left arrow and up arrow together simultaneously, for north east movement, how can I do it? I am only able to use one keystroke at a time , I need to catch two key strokes simultaneously, I need...

Audio Editing in iPhone : Adding sox library to xCode

Hi All, How to build the libsox.la library and integrate into xCode for editing audio in iPhone ? thanks ...

When is memory actually freed in Objective-C?

Hello all. I'm trying to understand memory management stuff in Objective-C. If I see the memory usage listed by Activity Monitor, it looks like memory is not being freed (I mean column rsize). But in "Object Allocations" everything looks fine. Here is my simple code: #import <Foundation/Foundation.h> int main (int argc, const char * a...

How to @synthesize a C-Style array of pointers?

I have a property defined in a class like so: @interface myClass UIImageView *drawImage[4]; ... @property (nonatomic, retain) UIImageView **drawImage; ... @synthesize drawImage; // This fails to compile I have found similar questions on StackOverflow and elsewhere, but none that really address this issue. What is the most Objective-C...

Could UINavigationControllerWillShowViewControllerNotification get my app rejected?

Hey guys, I'm observing UINavigationControllerWillShowViewControllerNotification on UINavigationController to keep track when the current view controller has been popped, as suggested on this post. There's literally no reference anywhere for that notification and a Google search will link me only to that post. Does it mean this is a p...

Custom UIButton + subviews = no events

Basically I have a custom UIButton and this custom button contains subviews. If I add those subviews to my uibutton, then the button stops responding to event changes. I.e if I click on it it doesn't respond to the selector. I have everything set as userInteractionEnabled. I also tried adding touchbegan and this is working. If I remove t...

Cocoa @sum array operator too slow - alternatives?

I've got a text field value bound to a key path that uses @sum. When the array controller is filtered, the text field updates properly, but extremely slowly, lagging the UI or outright beachballing after every key press (less so as the number of items in arrangedObjects decreases). There is no lag if I don't use @sum; I've narrowed it do...

Memory over-release problem when I am animating UIView

I have enabled NSZombie's and I am getting the following message in my console when I am running my application: *** -[UIViewAnimationState release]: message sent to deallocated instance 0xf96d7e0 Here is the method that is performing the animation -(void)loadAvatar:(STObject*)st { NSAutoreleasePool * pool = [[NSAutoreleasePo...

Init from nib, but alloc only [UIViewController]

So I'm doing this in my code now: UIViewController* ctrl = [[UIViewController alloc] // i'm alloc'ing a UIViewController... initWithNibName:@"TheNibName" // But this NIB has, within // interface builder, a link to "UIViewControllerDERIVATIVE". So really, // `ctrl` is a UIViewControllerDERIVATIVE instance, not...

How can I make a UITextView not selectable?

I have some text in a UITextView. I don't want it to be selectable. How can I do this? ...

How do I authenticate a Twitter user and access the API without leaving my iPhone app?

I'd like to allow users to send out Tweets from my iPhone app. That's all the functionality I need at the moment. From what I know of the Twitter API, there's a standard authentication mechanism, which allows the developer to include the user's name and password in the request string that the application sends to Twitter. This method w...

show UIAlertView when In app purchase is in progress

Hi... I've added an UIAlertView that has UIActivityIndicatior as a subview on my application. This alertView only show when the purchase is in progress. I've put my alert view in this way in my StoreObserver: - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transac...

NSStrings, C strings, pathnames and encodings in iPhone

I am using libxml2 in my iPhone app. I have an NSString that holds the pathname to an XML file. The pathname may include non-ASCII characters. I want to get a C string representation of the NSString for to pass to xmlReadFile(). It appears that cStringUsingEncoding gives me the representation I seek. I am not clear on which encoding to u...

Can 2 different type of devices or 2 different apps talk to each other via Peer-to-Peer Connectivity in GameKit

For example 2 iPhones are running 2 different apps. 1 iPad and 1 iPhone are running the same app. 1 iPad and 1 iPhone are running 2 different app. Does it has to be same devices running same apps? I've never tried this. Hope someone can tell me. ...

how to retrieve image locally from application and display it on UIImageView with objective-c

I have loaded the image in application's folder that is source but i could not find the code by which i will display that image on UIImageView using button click event.Please help me out for this. I have used this following code before UIImage *img = [UIImage imageNamed:@"xyz.png"] but i could not set the UIImageView image to img in th...

what is the difference between latitude, longitude and their delat values.

Hi! I'm new to the MKMapView (iPhone). I want to add several annotations to the map of Copenhagen (Denmark). I have the latitude and longitude values of different locations of the city. But I don't know how to get the longitudeDelta and latitudeDelta of these locations. I'm using the Google Map API's to calculate the latitude and longit...

Saving NSBitmapImageRep as NSBMPFileType file. Wrong BMP headers and bitmap content

I save a NSBitmapImageRep to a BMP file (Snow Leopard). It seems ok when i open it on macos. But it makes an error on my multimedia device (which can show any BMP file from internet). I cannot figure out what is wrong, but when i look inside the file (with the cool hexfiend app on macos), 2 things wrong: the header have a wrong value ...

How to implement the Tea Algorithm with objective c ?

hi,all i am a new object-c developer,i wanna implement Tea Algorithm, but i don't know more about the byte infomation ,so i cant control the string byte stream .who can tall me how to implement this Algorithm. thanks. ...