iphone

UITableViewCell textLabel and detailTextLabel tags?

I am designing an interface that basically looks the same as the Settings application. That is, I have a grouped TableView with cells that look like UITableViewCellStyleValue1. There are labels with values associated with them. The difference is, I am making custom UITableViewCell nibs so that the "value" can be a textbox, segmented cont...

When does setting an Objective-C property double retain?

Given the following code @interface MyClass { SomeObject* o; } @property (nonatomic, retain) SomeObject* o; @implementation MyClass @synthesize o; - (id)initWithSomeObject:(SomeObject*)s { if (self = [super init]) { o = [s retain]; // WHAT DOES THIS DO? Double retain?? } return self } @end ...

Accessing parentViewController's variables

I want to allow a pushed to set parentViewController's instance variables. For instance, VC1 (the parent) has a bunch of textfields and what not which are filled from VC2 (the child). VC2 is pushed onto the stack by VC1. I've tried doing like parentViewController.myString = "foo"; however since parentViewController is a UIViewController,...

When I load a texture as RGBA4444 in openGL, how much memory is consumed in the device ?

How much memory will consume a texture loaded with this method ? With this method, will a 1024x1024 texture consume 4MB anyway ? ( regardless of loading it as RGBA4444 ) ? -(void)loadTexture:(NSString*)nombre { CGImageRef textureImage =[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:nombre ofType:nil]].CGIm...

UIScrollView - with paging enabled, can I "change" the page width?

What's the simplest way to have a scroll view (with pagingEnabled set to YES) have a page width set to something other than the scroll view's bounds? Let me give an example. Suppose I have a scroll view with 10 items, each 150 pixels wide, and my scroll view is 300 pixels wide. If I start with views 1 and 2 visible and scroll horizontal...

Do I need an '@class' declaration in my AppDelegate.h file for every view controller in my project?

Please explain your answers as I've gotten away with not having to do this so far. Thanks ...

How to move a MKAnnotation without adding/removing it from the map?

Is it possible to move the coordinate of a MKAnnotation without adding and removing the annotation from the map? ...

iPhone img tag in local html file

I have an image that is set to content and is in the root of the bundle. I have verified it is there in the simulator. When I construct HTML to display in the UIWebView, this HTML fails to show the image: Is there a relative path it should be in? Note: I use the bundle as the base path in the call to show the html. (I use MonoTouch...

iPhone table scroll to

After my table view has loaded, I need it to scroll to the 12th row. How can I do this in the ViewDidAppear ? (In MonoTouch) ...

How to get valid URL from the string ?

Hi guys. I am using NSURLConnection on the application. To create HTTP connection, I used following code : NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.mydomain.com/path/[email protected]"] cachePolicy:NSURLRequestU...

Finding the top of mapview

From an MKCoordinateRegion, how do I tell what the top of a mapview's visible area is? The MKCoordinateRegion will have a center point (coordinates). Do I then add the latitudeDelta to the center point latitude to find the top of the map? Or must the delta be split in half and each half added and subtracted against the center point la...

IPhone Plain TableView Section Header Image and Getting Text on Two Lines

Hello, this is my first question, so if I didn't do the tags correctly, I'm sorry. I tried... Well here is my question: I am hoping someone can tell me how to do a 2-line section header for a plain tableview. The problems I am having are: 1) I cannot find an image that will mimic that of the default 1-line section header. Can someone sha...

Get current position of the viewport in Mobile (iPhone) Safari

I'm trying to position a div in the center of the iphone viewport. Basically so that when you hit an image, it pops up in the middle of the screen regardless of where you had scrolled to on the page before you clicked. It's not as simple as just making it position: fixed; as that will cause the origin to be the top of the page, not the ...

how to resolve warning implicit declaration of function in Objective C

log warning: implicit declaration of function 'TutorialAlertWithMessageAndDelegate' here my code .h void TutorialAlertWithMessageAndDelegate(NSString *title, NSString *message, id delegate); .m void TutorialAlertWithMessageAndDelegate(NSString *title, NSString *message, id delegate) { /* open an alert with OK and Cancel button...

Objective C - Writing an NSString to a plist

Hi, I'm writing an NSString to a plist file but after its written to the plist, and when I try to open i get the following message "This document "mylist.plist" could not be opened XML parser error: Unexpected character 2 at line 1 Old-style plist parser error: Unexpected';' or '=' after key at line 1" Here is my code: NSString *te...

Comparison of JSON Parser for Objective-C (JSON Framework, YAJL, TouchJSON, etc)

As far as I know, there are three JSON Parsers for Objective-C, JSON Framework, YAJL, and Touch JSON. Then, These three would have their own characteristics. For example: YAJL can be used as a SAX style parser. JSON Framework has relatively long history and is widely used. Touch JSON parses NSData instead of NSString. In addition, as f...

Countdown timer iphone sdk??

I have a countdown timer in my game and I'm trying to figure out how to make it so that it shows two decimal places and records with 2 decimal places in my table. Right now it counts down as a whole number and records as a whole number. Any ideas? -(void)updateTimerLabel{ if(appDelegate.gameStateRunning == YES){ ...

Draggable UIView

I have 4 UIViews inside of a main view controller view. All I need to be able to do is drag the views around the "screen". Is UIScrollView the best option for this, or is there a simpler way? ...

How can I view an XIB from an app store app?

I downloaded an app with nice design and unpacked it's contents. I'd like to look at the NIBs to see how the app is put together. I renamed the NIBs to XIB, but Interface Builder won't open them ("Interface Builder was unable to determine the type of PageView.xib"). Is there any way to force it to open the file. Would I be able to see an...

First iPhone App View Position Problem

I am closely following the instructions given in the tutorial "Your First iPhone Application" on apple ADC. In the interface builder, I have set up a button positioned on the top according to the Apple Interface Guidelines. It runs without trouble if I simulate the interface in IB. However, if I run the built app, I get what is shown he...