cocoa-touch

Reasons for an iOS thread to exit prematurely?

I have a block of code in my iOS app that fills an array with Core Data objects on a background thread, via NSOperationQueue, then notifies the UI on the main thread when it completes. Everything has worked perfectly in iOS3. However, in my new iOS4 build, I started noticing an occasional bug where the UI never gets notified that the da...

Why doesn't my UIImageView respond to taps?

I have a UIImageView that's being loaded from a NIB. I've hooked up a gesture recognizer to it to handle taps, but when I run the app, taps aren't being detected. ...

How to put a UILabel ontop of a UIToolbar?

I have a UILabel that shows a character count as the user types into a textfield. Currently it is sitting behind a translucent UIToolbar. I would like the UILabel to be ontop of the UIToolbar. How can I accomplish this? ...

How can I change the font color of a UIBarButton item?

I want to change the color to red. ...

What files do I need to distribute if requested to comply with LGPL in an iPhone app?

I'm working on an iPhone app which uses the Zbar library which is under the LGPL licence. What I'd like to know is what I need to give someone if they request a copy of the code under this licence for my iPhone app? I've been told they are in the build folder and also that they are .o files. I've found some of those in the armv6 and arm...

How can I determine if a user has pressed on a UITableViewCell for 2 seconds?

I am using gesture recognizers: Initialize in viewDidLoad: UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)]; [self.view addGestureRecognizer:longPressRecognizer]; This is what longPress looks like: - (void)longPress:(UILongPressGestureRecogni...

cant figure out this JSON string

I'm trying to use the google translate api's to... well translate some text, but its behaving strangely. When my query (the text to be translated) contains no spaces, it works fine, however as soon as I introduce a space into the query, i get no results back. This is my code: -(void)translateText:(NSString *)originalText { //Constru...

Problem presenting a UIActionSheet from a double tap in UITableViewCell

I am presenting a UIActionSheet when a user double taps my cell: Tap Recognition in Cell Init: UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; [doubleTap setNumb...

Is there a way to detect when a standard iPhone View Controller push/pop animation has completed?

For custom animations in my app, I can use the setAnimationDidStopSelector: method to respond to the event that an animation has finished. Is there a similar kind of mechanism for detecting that the animation has finished for a standard View Controller animation transition for pushes and pops? (i.e. [self.navigationController pushView...

Passing variable to another view (using Utility template)

Okay, so I'm obviously a newbie, but I need some help passing a variable to another view. I'm using the Utility Template in Xcode. I think I have everything linking properly (including the proper header files and whatnot). Just don't know the proper syntax. Here's what I'm trying: NSDate *time =[flipsideViewController.datePicker date];...

iPad: Measure/detect covered area by a finger touch on screen (NOT only touch coordinates)

Hi I would like to get access to the area covered by a finger for each touch event on an IPad. Every touch event will result in a coordinate pair X and Y independent of how big the finger and consequently the touch area is that triggered the event. I was wondering if there is a way to get the area data which triggered the touch even...

MPMoviePlayerController with custom controls

I added some custom controls to a MPMoviePlayerController. Ths is explicitly written in the documentation that tis is possible: You can add subviews to the view in this property. You might do this in cases where you want to display custom playback controls or add other custom content that is relevant to your application. But this w...

accessing the parent of an object

I'm trying to call methods on the parent of my object by passing the parent in as property. But i keep getting this error: expected specifier-qualifier-list before 'Wheel' @interface Car : NSObject { Wheel *w; } - (void)doCarStuff; @end @implementation Car - (id)init { if((self = [super init])) { //w = [[Wheel al...

Iphone -ScrollView smearing the view and the text

Hi, I registerd for the keyboard show event, and implemented the method like this : -(void) KeyboardDidShow:(NSNotification*)notif{ if (KeyboardVisible) { NSLog(@"Keyboard is already visible"); return; } NSDictionary* info = [notif userInfo]; NSValue* value = [info objectForKey:UIKeyboardBoundsUserInfoKey]; CGSize keyboard...

iVars, With and Without self?

I am just curious about the role that self plays within an object. I understand that writing [[self dataForTable] count] refers directly to the iVar contained in that object. But if you miss self off and directly specify the iVar [dataTable count] how does that differ, what are you protecting against by using self, is it just to uniquely...

Cocoa Touch - Create an image and display it at a specific point

Hi! I want to display an imageview at different point (the points defined by random numbers). So how can I create an imageview and set its position all programically? sorry if its confusing i dont know how to explain it.. ...

Connecting to sqlite in iphone development

Hi all, I have used sqlite database in some of my iphone applications but as you know it is a lot harder than other languages such as java and php to use database. Is there any way to use database easier !? I found a framework in sourceforge here : http://mysql-cocoa.sourceforge.net/ but I think it is not for cocoa-touch. Is there any ot...

UILongPressGestureRecognizer gets called twice when pressing down

I am detecting if the user has pressed down for 2 seconds: UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; longPress.minimumPressDuration = 2.0; ...

Problem making UITableViewCell text white when selected

When my user clicks on a cell I want the text to turn white: - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; lblName.textColor = [UIColor whiteColor]; lblTime.textColor = [UIColor whiteColor]; } This works fine, but when the user selects another cell, the previ...

XCode: Two targets, two main files?

I'm working up a game in XCode, and I want to add a helper application that uses the main application's various classes to build the main application's data files. Specifically: The main application is a card game. I want a helper app that uses the classes such as card.m while it creates the deck.xml files for the deck of custom cards t...