iphone

automatically wrapping text in scrollview?

hi, i have displayed one text in UIview (through drawRect ) with UIScrollview.but when i zoom , the text goes ouside of the frame , i want to wrap automatically , any help please? ...

CoreGraphics on iPhone. What is the proper way to load a PNG file with pre-multiplied alpha?

For my iPhone 3D apps I am currently using CoreGraphics to load png files that have pre-multiplied alpha. Here are the essentials: // load a 4-channel rgba png file with pre-multiplied alpha. CGContextRef context = CGBitmapContextCreate(data, width, height, 8, num_channels * width, colorSpace, kCGImageAlphaPremultipliedLast | kCGBi...

iPhone. Particle system performance

I try to draw rain and snow as particle system using Core Graphics. In simulator rendering proceeded fine but when I run my app on real device rendering is slow down. So, advise me please approaches to increase particle system drawing performance on iPhone. May be I should use OpenGL for this or CoreAnimation? ...

Error in PushNotification from iPhone Device

Hi All, I am trying to do a sample project on the Apple the push notification. I created an AppID, done some terminal commands, and finally got a Provisional Certificate for do the same. I got the certificate installed on my device and SDK. Till now every thing goes fine. But when i try to run the app on the device.... it doesnt. It th...

How to remove view from window?

I am using Cocos2D for my main framework. In some cases, I want Cocos2D to load a nib file and have that be the view: window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; TargetPlayerViewController *myController = [[TargetPlayerViewController alloc]initWithNibName:@"TargetPlayerViewController" bundle:nil]; [window ...

How does glClear() improve performance?

Apple's Technical Q&A on addressing flickering (QA1650) includes the following paragraph. (Emphasis mine.) You must provide a color to every pixel on the screen. At the beginning of your drawing code, it is a good idea to use glClear() to initialize the color buffer. A full-screen clear of each of your color, depth, and stencil buffers ...

Iphone: How to read return value of strftime SQLite function

I need to read the column value of the following query SELECT strtime('%Y-%m', created_at) as field FROM table GROUP BY field the type of column field is 3 (I assume it is blog), but I need string How should I? Updated const char* sql = "SELECT CAST(strftime('%Y', created_at) as INTEGER) as year FROM table GROUP BY year i...

iPhone SDK: Memory leak on picker

I have created a picker for my users to pick from a list of countries. The problem is that repeated opening and closing of the picker is resulting in “EXC_BAD_ACCESS” error. I suspect it might be a memory leak but I am not sure. I was hoping someone could shed some insight into why this might be happening? //data source for UIPicker NS...

Save image to camera roll with UIImageWriteToSavedPhotosAlbum

Hi , i try to save a photo with a button to camera roll after user capture a picture with Camera , but i dont know why my picture doesn't save at photo library !! here is my code : -(IBAction)savePhoto{ UIImageWriteToSavedPhotosAlbum(img.image,nil, nil, nil); } -(IBAction)takePic { ipc = [[UIImagePickerController alloc]init...

XCode and developer tools

I want to use the FileMerge utility on my mac, but it isn't installed. I searched in Google and there is written that it will be installed with the developer tools. Where can I find the developer tools? I downloaded the iPhone SDK 3.2 beta 5 and installed it, but I can't find the download location of developer tools. ...

vnc application for iPhone. How to go about building one?

Alright.. I am on a mission to learn iPhone development as much as possible. At my current job they have requested me if I can build a vnc viewer in iPhone.. there are many vnc apps but i want to learn how to build an app like that.. what would be the architecture of this app how should i organize my app? Edit: Specific question: Is ...

threading problem (EXC_BAD_ACCESS)

Hi all, the following code crashes the application, and I don't know why. It crashes irregularly, that means that sometimes the imageview can be shown for example 30 times when a row is clicked, sometimes it chrashes the second time when I select a row. FYI: the activity indicator,the action sheet and the variable imageNr are defined g...

How to set the width of a cell in a UITableView in grouped style

I have been working on this for about 2 days, so i thought i share my learnings with you. The question is: Is it possible to make the width of a cell in a grouped UITableView smaller? The answer is: No. But there are two ways you can get around this problem. Solution #1: A thinner table It is possible to change the frame of the table...

UITextField keyboard difference between simulator and real device

Hi, I am trying get float value with UITextField. On the simulator V3.1.3 in English, I have to use '.' to separate my float values. But on my Iphone 3GS V3.1.3 in French, I have to use ',' to separate them. If I use '.' on my Iphone 3GS, my float is troncated : 3.22222 => 3.0000000 Is there a solution to detect the language version and...

How do I draw or get an image of a ring (donut) chart for use in an iPhone Application?

I want to be able to show some account information in a ring chart. I am able to show this in a pie chart format via Google chart APIs in my iPhone application, but my requirement is to show the information in a ring chart (also known as a donut chart). Does anyone know how to do this? ...

How can I determine if a UILabel was touched?

I am trying to determine if a UILabel was touched and if so do something. Give .. . . . UILabel * site = [[UILabel alloc] initWithFrame:CGRectMake(0, 185, 320, 30)]; site.text = [retriever.plistDict valueForKey:@"url"]; site.textAlignment =UITextAlignmentCenter; site.backgroundColor = [UIColor clearColor]; site.textColor = [UIColor whit...

How to load an external view in a NIB?

I have a ViewController that has its own NIB. I would like to embed that NIB inside of another master NIB. How can I accomplish this in Interface Builder and how do I reference it in code? ...

super dealloc error using multiple table view calsses

I am new to Iphone apps and I am trying to build a tab based app. I am attempting to have a table ontop of an image in both tabs. On tab with a table of audio links and the other tab with a table of video links. This has all gone swimmingly, I have created two viewControllers for the two tables. All the code works great apart from to ge...

how to draw an UIImageView into -drawRect of another view?

I have several UIImageView objects which have been rotated and scaled. Because they are just background images, and represent an non-highlighted-state, I want to draw them to the canvas of the view so that I can get rid of them in memory. The view has a big bitmap anyways, so it would save a lot of memory to put them in there rather than...

iPhone application launch time guidelines

Please point me to the iPhone application launch time guidelines. I see that there is a hard limit of ~24 seconds. OS kills application if it did not started in that time with the message: com.bundle.id failed to launch in time There is also a QA article on this. (24 seconds is the time until OS on my phone kills the app.) But I thin...