iphone

Vertically add elements to a scrollview: diffs between Java and iPhone SDK?

Folks, coming from the Java/Swing world, I am sometimes puzzled by the UI programming on the iPhone. I've spent the last hours with Googling for information but it seems that I asked the wrong questions by thinking too much in Java. Could you please point me to resources to get more familiar with the GUI concepts to be able to achive th...

Is it possible to cover UIStatusBar with a view while maintaining scrollsToTop functionality?

I want to display a message to the users of my app in the UIStatusBar, but I'd like to maintain the scrollsToTop functionality so a user can tap on the statusbar and scroll a tableView up to the top. I've looked into adding a UIWindow on top of the current status bar as in this question: http://stackoverflow.com/questions/2666792/add-u...

How can I create and display a UISlider programatically

How can I create and display a UISlider programmatically and display it. I found the code below in Apple documentation and added it to my viewDidLoad method but the slider doesn't appears when I run the code. CGRect frame = CGRectMake(0.0, 0.0, 200.0, 10.0); UISlider *slider = [[UISlider alloc] initWithFrame:frame]; [slider addT...

Getting Access to the touch event in an UIAlertView.

Hello all, I am displaying a Customized UIAlertView. I need to know how to get access to the touch events taking place in that AlertView. I have a controller class which is set as the delegate of my customized UIAlertView, with the following method, but this is not triggered on touching being taking place in AlertView. - (void)touches...

how to darken a UIImageView

I need to darken a UIImageView when it gets touched, almost exactly like icons on the springboard (home screen). Should I be added UIView with a 0.5 alpha and black background. This seems clumsy. Should I be using Layers or something (CALayers). ...

Profiler for XCode, iPhone.

Does anybody know of a 3rd party profiler for XCode with the iPhone? I really don't like instruments, it's a pain to try to figure out whats going on. Allocations and leaks are fine, its just the CPU Sampler that I don't like. I really liked Shark but they have stopped updating that and it doesn't work with iOS4. ...

How to build universal ios static library

Hi I'm trying to build a static library that I can use with both ios3.x and ios4.x. I can build a static library with ios3.0 that works with another project in ios3.0 but won't compile in ios4. The same is true going from ios4 to ios3. Here's how to recreate: Open XCode 3.2.4 and start a new project that's a Cocoa Touch Static Libra...

UITableView not populating in Tab bar iPhone application

I have a tab bar application which loads a UITableView when one of it's buttons are selected. It seems to load the view controller however it doesn't seem to be populating the data. I have tried setting the cell.text = @"cell" (while setting the number of rows > 0) and an NSLog in the CellForRowAtIndexPath proves that in fact the functio...

Multiple buttons on navigation bar

I am using code from http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html to implement multiple buttons in the navigation bar. The huge problem I have now is that this construction "leaks" into the main window. By this I mean that if I press (up to about 15px) below the navigation bar the buttons still respond....

deleting row in SQLite 3

In UITableView, I want to delete a row and remove that row on database, but my query of sqlite don't works. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { UIAlertView *view; ...

How can I do login with google adsense in an iphone app?

How can I do login with google adsense in an iphone app? Someone can show me the code? or tell me something about? Thanks ...

Dismissing the keyboard for a UITextField in UIAlertView.

Hi, I have a Customized UIAlertView.I have a UITextField in that AlertView, which becomes the firstResponder as soon as it is shown. Now I need to dismiss the keyboard for that UITextField when user touches somewhere else in the AlertView. I have touchesBegan event for that. Everything is in place and works fine, except when I call re...

Simultaneous Sprite Touch Detection - iPhone & cocos2d

I am writing an app for the iPhone using cocos2d where I have 4 Sprites that are buttons. I figured I would implement the button functionality by using 2 sprites with different .png files representing the pressed/unpressed states. I thought this would be better than using an animation. In addition to detecting when the buttons are pre...

iTunes App Store Accepts Non-Native Apps?

This question is for anyone that's had personal experience. The question is simple: Does Apple accept iPhone apps that haven't been written using their SDK? Apps can be written using different languages these days, and then compiled into iPhone apps. Does Apple even care? Edit iPhone apps can be created using Java and Flash CS5, which i...

App Delegate giving warning: 'id <UIApplicationDelegate>' does not conform to the 'UIAlertViewDelegate' protocol

Hello everyone, I'm currently using a UIAlertView at startup in my app with the UIAlertViewDelegate. It all works fine. The only problem is, I get the warning "type 'id ' does not conform to the 'UIAlertViewDelegate' protocol" every time I reference the App Delegate, giving me about 32 warnings. Can anyone shed some light on why I'm g...

Anyone could exlain width/height returned from iphone camera taken image on iPhone 4?

I am using - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo to take the image. Then use CGImageRef imgRef = image.CGImage; CGFloat width = CGImageGetWidth(imgRef); CGFloat height = CGImageGetHeight(imgRef); For some reas...

Fade out image but not text on UILabel for iPhone

Hi, I have a label I have added a background to like this: myLabel.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"some image"]]; The user will enter text into the label and when finished, I would like to have the background image fade away but have the text remain. I've tried UIView Animations but UIImage does ...

Blocks instead of performSelector:withObject:afterDelay:

I often want to execute some code a few microseconds in the future. Right now, I solve it like this: - (void)someMethod { // some code } And this: [self performSelector:@selector(someMethod) withObject:nil afterDelay:0.1]; It works, but I have to create a new method every time. Is it possible to use blocks instead of this? Basi...

How can i make visual keyboard appear above my UIToolBar?

I have a UITextView at the midle of View, UIToolBar at the bottom of View. I want visual keyboard appear above UIToolBar when i touch on UITextView. How can i do it? ...

Change UI Draw Order on iPhone

I currently have a UI built in Interface Builder-- it is basically consisted of a background image and a few labels. I need to animate some elements (images) underneath the labels but over the background, but I also need to draw them in a specific z-order. I was looking around and came across CATransformLayer-- I'm still looking into it...