cocoa-touch

Creating CGImageContext for resizing UIImage fails in simulator

I've got some code to resize a UIImage (in a category to UIImage), that first generates an Image Context: CGImageRef oldImage = [self CGImage]; CGSize oldSize = [self size]; CGContextRef context = CGBitmapContextCreate(NULL, //Data newSize.width, //Width newSize.height, //Height CGImageGetBitsPerComponent(oldImage), // Bits...

How to simply fill a TableView for iPhone

I have got an UITableView. How to simply fill it with three elements, for example "e1", "e2", "e3" ? ...

iPhone Mic volume.

Is there any way to poll the mic input volume with AVFoundation? I have seen the CoreAudio examples like SpeakHere but I really only need the current value. Is CA my only option? ...

Leak - GeneralBlock-3584

When i try to check leaks of my iPhone App using Instruments, everything is just fine. Same App on actual real device shows this leak for a few times during the app launch. It is pretty non-deterministic and it happens in system libraries. I tried to google down the solution without a luck. Anyone experiencing the same problems? Anyone k...

Change User Agent in UIWebView (iPhone SDK)

I have a business need to be able to customize the UserAgent for an embedded UIWebView. (For instnace, I'd like the server to respond differently if, say, a user is using one version of the app versus another.) Is it possible to customize the UserAgent in the existing iPhone SDK's UIWebView control the way it is, say, for an embedded I...

What classes do I use to make an iPhone act as a server?

I'm looking for an easy way for users to download content from an iPhone to their computer. I've seen other apps that actually turn the iPhone into a server and give the user an IP address to navigate to on their computer. I've glanced at some Apple samples, but nothing looked too much like what I was going for. So what's the easiest ...

-[UITableView scrollToRowAtIndexPath:] scrolls, but goes back to 1st row

Hi I have a grouped table view with textfields in the tableview. For the keyboard to not hide the textfields, in the textFieldShouldBeginEditing, I am calling the scrollToRowAtIndexPath method and setting the scroll position of the row being edited to the top of the tableview. The scrolling does happen, but as soon as the keyboard appe...

How can I bookmark a spot inside a UITextView?

I have a large amount of text in a UITextView. I want to let the user press a button and save the line that is displayed at the top of the view. Then when the same button is pressed it jumps to that exact line when the app is opened at a later time. Just like a physical bookmark. How can I determine where the text is, or scrolling is? H...

How to add a TabBar to NavigationController based iPhone app

I have a simple NavigationController based app. The main window shows a TableView and selecting an item loads a sub-view. I used Interface Builder for UI views. Now I want to add a TabBar to the app. Where do I put it? Do I need a TabBarController? Should it go in the MainWindow.xib, or RootViewController.xib? How do I tie it together ...

Storing my ObJ-C class online. (amazon web services?)

Okay this is a fairly broad question. This is my first App and I'm not sure the best way to go about this. The app is on the IPHONE. I have a 'Restaurant' class. The restaurant has many different attributes and opening times. I currently store a restaurant in an instance of nsdata (it complies to NSCoding) LOcal storage is easy and I j...

QuartzCore.framework problem

I am trying to use QuartzCore Framework but when adding this framework to my iPhone application, I am told that the files (e.g. CIColor.h and others) are missing but those missing files exist on my hard drive under /system/library/ In addition to the QuartzCore Frame work, I am using the following frameworks: cocos2d, cocoa.framework, o...

TextField with Keyboard in cocos2d !

hello, I am trying to develop a iphone app by using cocos2d. I create a alert view with a text field. when I touch the text field then comes the keyboard. But I want that when the alert is open, in the same time textfield will be selected and keyboard comes(without any touch). how can it posible ? sorry for my bad English. ...

OCMock: Make a stub do something

I'm getting used to OCMock. Coming from a Java/JMock background I'm now looking for the ability to say [[[myMock stub] returnValueFromCustomMethod] someMockedMethod]; where returnValueFromCustomMethod is defined in the test class. I was originally thinking something along the terms of [[[myMock stub] usingSelector:@selector(myMethod:)] s...

What methods do I have to implement in order to re-arrange the UITableView rows?

For a simple example of using a NSMutableArray of strings called rows, what do I have to implement in my table controller to move the tableView rows and have the changes reflected in my array? ...

How do I create a Cocoa touch template using the iPhone SDK?

I downloaded the free iphone sdk. Now when I try to create a new project I am not given the option to create a cocoa touch template. I only have the option to create a Mac OS X template. Does anyone know why this would occur and how to fix it? Edit: if you start then restart a download does that damage the downloaded material? ...

how can I use animation in cocos2d ?

hello, I am trying to develop a Roulette game for iPhone. How can I animation (spin) the Roulette board? ...

Add SQLite Database to iphone app

Hi all, i am trying to learn SQLite and i am building an iphone app. but i would like to add SQLite database to my building app. i have got three tutorial but i am not clear on that code. pls send some ideas how i can add SQLite database to my building app. it would be more help if i get code for this. ...

Changing view controllers navigationItem view?

I'm trying to duplicate the functionality of the "Obama" app. I want the navigationBar image on the tableview controller to be one graphic. I want a different graphic to be the background image on the UIWebView controller that get's pushed when I touch a tableCell in the initial tableview. I have a tableview controller. At the top of th...

iPhone GPS Development - Tips + Tricks

Hello - I'm looking for some feedback, blog links, etc that offer some tips and tricks for iPhone GPS development. I've read and understand the API, I have my demo app up and running, etc but I have run into some "quirks" with gps on iphone. For example, it seems that you you will receive a lot less location updates when your iphone ent...

How can I animate manually on the iPhone?

I've got a very simplistic "game" set up on the iPhone. Things move around, rotate, you can interact with them, etc. In the simulator, it runs fine, but on the device it gets around 0.25 FPS, and it's so slow that it doesn't have time to recognize touches, apparently. This was originally just using a UIView with an array of Items each...