cocoa-touch

iPhone: Get a list of clickable areas on screen in cocoa touch

Hi All, I have an iPhone app and I want to get a list of co-ords that are clickable by a user. I want to automate testing and have a client app click around on screen but just choosing random coords isn't ideal so a list of coords that are definitely clickable would be much better. So far I have this the view passed in is top level wind...

How do I fade in /out a rectangle or text?

Hi all, I want to achieve the effect of fade in / fade out the rect or text. I call CGContextFillRect or CGContextShowText in my UIVIew's drawRect: method. I wonder if there is a way to achieve the animation without using UIView' support(i.e. [UIView beginAnimations::]. The desired effect I want to achieve is similar to what in Micros...

Keyboard not show onload

Hello I want the keyboad show automatically onload, but it did not work as i expect here is the code i use: - (void)viewDidLoad { [super viewDidLoad]; [seachBar2 setDelegate:self]; } - (BOOL)Searchbar2ShouldReturn:(UISearchBar *)searchBar2 { [searchBar2 becomeFirstResponder]; return YES; } Coud somebody will poi...

Background threads consuming 100% CPU on iPhone 3GS causes latent main thread

In my application I am executing 10 asynchronous NSURLConnections within an NSOperationQueue as NSInvocationOperations. In order to prevent each operation from returning before the connection has had a chance to finish I call CFRunLoopRun() as seen here: - (void)connectInBackground:(NSURLRequest*)URLRequest { TTURLConnection* connecti...

UIDeviceOrientationUnknown in landscape mode

I am trying to figure out what orientation the iphone has in the simulator and instead of giving it to me using the UIDevice orientation property I just get UIDeviceOrientationUnknown. Does this property not work in the simulator? What could be the possible reason for this happening? I am using opengl es ...

iPhone Email app launch url

The url to launch email and start a new email on an iphone is "mailto://[email protected]". I just want to launch the email app, dropping the user at the main menu, or inbox. "mailto:" starts composing a new blank email I've tried "mail:", "email:" and a few others. Is there no way to just launch the email app? ...

I am trying to add a drop shadow to a UImageView

I am trying to add a drop shadow to a UIImage view. I get a shadow but it is clipped to the edges of the image view and I am not sure why since I correctly set the uiimageview.clipsToBounds to NO. Below is the code: -(void)addShadow { UIGraphicsBeginImageContext(self.frame.size); CGContextRef myContext = UIGraphicsGetCurrentConte...

Distinguishing between didSelectRowAtIndexPath and accessoryButtonTappedForRowWithIndexPath

I've implemented didSelectRowAtIndexPath and accessoryButtonTappedForRowWithIndexPath never seems to fire. However, didSelectRowAtIndexPath always fires, even when I click the accessory. Shouldn't these two be exclusive? ...

Blending Three Images into Graphics Context Using Alpha Blend Mode kBlendModeOverlay

Does kCGBlendModeOverlay not work exactly like Photoshop's Overlay blending mode? I'm trying to overlay three images into a graphic context via: [uiimageGreen drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0]; [uiimageRed drawAtPoint:CGPointMake(x, y) blendMode:kCGBlendModeOverlay alpha:1.0]; [uiimageBlue drawAtPoin...

How do I create a UIImage from a 3d transformed UIImageView layer?

After applying a 3d transform to an UIImageView.layer, I need to save the resulting "view" as a new UIImage... Seemed like a simple task at first :-) but no luck so far, and searching hasn't turned up any clues :-( so I'm hoping someone will be kind enough to point me in the right direction. A very simple iPhone project is available he...

How can we add array values to dictionary for particular birthday month? I am getting prob like dictionary values for particular month every time is overwritting by previous month

NSUInteger i; int prevMonth = 0; NSMutableArray *array = [[NSMutableArray alloc] init]; bDayDict = [[NSMutableDictionary alloc] init]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateStyle:NSDateFormatterMediumStyle]; for(i = 0; i < [bdatesArray count]; i++){ NSLog(@"bdates array is %@",bdatesArray); ...

In the below code values in dictionary are overwritten every time with another month ..how can i solve this prob.can anyone help me out please..

// Write code for sorting bdatesArray into a NSDictionary object here !! NSUInteger i; int prevMonth = 0; NSMutableArray *array = [[NSMutableArray alloc] init]; bDayDict = [[NSMutableDictionary alloc] init]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateStyle:NSDateFormatterMediumStyle]; for(i = 0; i < ...

How do I get the position and size of an image after applying a transform?

Hi, all! Currently I'm developing a game in which I've an imageView which I'm scaling little by little & rotating at the end. I want to obtain the size of image & its coordinates ar the end of scaling which I need for 3D rotating the imageView which I need to redraw the image & apply rotation to it. I'm using if(ravanImage.cen...

Iphone delegate memory leak problem

Hi Folks, I need your help, i'm stacked on this project. When i run my applicaion into Instruments, →← marked line giving memoryleak. When the fist run everything is ok but second time →← marked line giving memory leak, i didn't understand why ? I tried a lot of things, i used NSAutoReleasePool as well but result same. Can someone ...

A method that takes both NSArray and NSMutableArray

I want to create a method that can take an NSMutableArray or an NSArray object. I think I can just use (id) as the parameter type... or convert the NSArray to NSMutableArray before passing. However I'm not really happy with these solutions. In other languages I might pass an IList or some shared object that they both inherit from... ...

Problem adding subviews (UIButtons) to subclass of UIImageView

I'm adding a custom button/keypad to my application. Thus far, I have a UIImageView subclass that contains an animation that slides it from the bottom of the screen, and then back down when the user no longer needs it. I'm having trouble adding UIButtons to this UIImageView, however. Since this is a subclass of UIView, I'm attemptin...

When does webViewDidFinishLoad get fired?

Does anyone have a precise understanding of when webViewDidFinishLoad is called on a UIWebViewDelegate? I've read that it fires once per iframe, if they exist, but I'm concerned about exactly when it loads with respect to the DOM and javascript events. Is all of the javascript and DOM guaranteed to be downloaded, interpreted and ready ...

How can I compute the duration for a UIViewAnimationCurveEaseOut animation with a known starting velocity and distance?

I'm animating a view between two points using UIViewAnimationCurveLinear, so I know the velocity of this animation. In certain circumstances I want to append a UIViewAnimationCurveEaseOut to make the view slow to a stop. To make this effect seamless, the ease-out animation must start at the same velocity as the linear animation that pr...

iPhone memory management(Specially for property)

I have a very clear question: //.h file @property (nonatomic, retain)NSMutableString * retainString; @property (nonatomic, copy)NSMutableString * copyString; //.m file @synthesis retainString, copyString; -(void)Process { NSMutableString *test = [[NSMutableString alloc]inti];//retain count should be 1 self.retainString = test; ...

CoreData Sqllite protection

Hi Guys, I like to use CoreData and their entity model into my projects. I need to know that how to store sqllite database into Iphone securely. As everybody knows when the Iphone broken with jailbreak it have file system navigatable, that mean for me, someone or somebody easly open or copy to another envorinment my sqllite db. How do ...