iphone

Scrolling UITextView programmatically

I'm implementing some simple text chatting capabilities in my app and I'm having issues with scrolling the UITextView programmatically. I'm using a UITextView created in Interface Builder that appends a new line and some text to the preexisting text. When the new text is added it should scroll to the bottom. I built a test application t...

Arc / Circle animation in iphone

Hi, How would I animate a circle on the iPhone so that the arc starts at "0 degrees" and ends at "360 degrees"? Advance Thanks, Sat ...

Is a Persistent Store a requirement for Core Data on the iPhone?

Hey guys, I'm looking to use Core Data within my iPhone app. The app doesn't really need to store the data that is used, but it needs to be managed and queryable. Can Core Data be used for datasets that exist purely in memory and are not persisted to the disk? ...

When should you NOT use the asterisk (*) when declaring a variable in Objective C

I have just started learning objective c and the asterisk is giving me some trouble. As I look through sample code, sometime it is used when declaring a variable and sometimes it is not. What are the "rules" for when it should be used. I thought it had something to do with the data type of the variable. (asterisk needed for object data t...

How do I get the next and earlier date of the current date in iPhone sdk

Hello, I have a date object, NSDate *date = [NSDate date]; Now I want a date earlier of this date and next of it. What function should I use. Earlier and Later means a day before and a day after. Also I tried using earlierDate but may be I am using it wrong since it is returning the same date. tnx. ...

How to implement scale-9 for custom background art created for UIButton

What do I need to do programatically in order to use the same background image for UIButton of variable size? (commonly known as 9-slice scaling or scale-9) ...

Connecting to APNS for iPhone Using Python

I'm trying to send push notifications to an iPhone using Python. I've exported my certificate and private key into a p12 file from keychain access and then converted it into pem file using the following command: openssl pkcs12 -in cred.p12 -out cert.pem -nodes -clcerts I'm using APNSWrapper in Python for the connection. I run the fo...

How does Quartz handle texture compression?

I'm developing on the iPhone and the majority of our game is using OpenGL ES, but there are also menus that use CGImage and Quartz in order to be displayed. In OpenGL ES, I know that no matter what image compression goes in (JPG, PNG, etc.), the data stored in memory as a texture is an 8-bit texture, unless I use PVRTC in which case I ca...

Multiple Modal-view Transitions Crash App

I would like to present multiple modal views in sequence (e.g. show confirmation page after selecting a picture from image picker). My problem is that the animation of dismissal and presenting in subsequent steps without delay always crashes the app with an EXC_BAD_ACCESS. I assume that the problem is that CoreAnimation does not distin...

How to get a Number key Pad with a point in iPhone.

Hi I am using the following code for a text box UITextField *txt_field = [[UITextField alloc] initWithFrame:frame]; [txt_field setKeyboardType: UIKeyboardTypeNumberPad]; Now When I click on the text field, a number pad comes up which dont have a decimal point option. I want a text field with just number pad where user can enter the nu...

Why does Xcode's autocomplete always think my properties are int?

I've been seeing this for well over a year and I can't figure out if it's a bug or I'm doing something wrong. When I declare a property in one of my classes like @property (nonatomic, retain) NSString *aString; And I go to use this somewhere else like myObject.aStr[ESC] When the list pops down with all the suggestions, aString is ...

Can We resize the UIDatePicker View in iPhone

Hi, I want a UIDatePicker View in a smaller size with respect to what it comes with. Is it possible to resize it? ...

Custom Cell from Nib UITableView

Hello, I have been trying various methods with no success to alter the following code... I have a nib file that works fine if I set all cells to this but I only want one of the switch statements to have the custom cell nib file. Any ideas? -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)ind...

How to change the width of the row of a UITableView

Can we resize the width of the row of a UITableView. ...

iPhone app: SDK 3.0 : Button Selected State: Can't get working!!!

Trying to do simple button functionality. Button A. It has 3 states: default, highlighted, selected. Should UNSELECT when clicked again. For the life of me, I can't even get a simple 3 state functionality established. Highlight (on press) appears built in (goes to "stock" blue). I"ve used Button Attributes to load in image for select...

Using NSStream to communicate with PHP?

I'm working on an iPhone project that needs to receive data from a PHP script during execution. My first thought was to use sockets/streams on either end to connect the two, but I am having trouble finding information on how to do this from the iPhone side. Has anyone been down this path that could point me towards some useful resources...

Iphone sdk : Tab Character inside a textview

How can I display a Tab (\t) on a textview ? I have a small piece of code (Example Below) which is well formated with Tab's and new lines. But when I view this code on a text view it does not show the tab's, but it does show the new lines. @interface Animal : NSObject { NSString *name; NSString *description; NSString *ima...

Problem with NSSearchPathForDirectoriesInDomains

I am trying to work directories. Unfortunately i get a non-writeable directory when I run NSSearchPathForDirectoriesInDomains. What I get is: /Users/me/Library/Application Support/iPhone Simulator/User/Documents When I run other people's examples I get: /Users/me/Library/Application Support/iPhone Simulator/User/Applications/6958D21C-...

iPhone Music App: Playing from a Cache of Notes

Hey everyone, I am working on an app that will play back notes from a 12-tone diatonic scale that spans several octaves. This will basically be a makeshift wavetable synthesizer. Times that with the number of instruments to use. The notes are stored as .wav files and will be cached into RAM to prevent overhead from hard drive retri...

Detecting Touch on PNGs with Alpha

I am trying to detect a touch event on a PNG image loaded into a UIImageView. I have everything working fine except that the touch is being tested for the bounding rectangle around the image (as expected). What I would like to do is test if the user has selected part of the visible PNG as opposed to the UIImageView itself. For example ...