iphone

Placing a UITextField in the center of the view

Hi I have a UITextField and I wnat to center this field on the center of teh view any ideas usernameField = [[UITextField alloc] initWithFrame:CGRectMake(0, 200, 200, 28)]; instead of CGRectMake(some numbers) - I wnat to place it in the center of teh view Thanks ...

Using va_list and getting EXC_BAD_ACCESS

Similar to how NSLog takes variable argument list, I want to create my own method. I have my method declared like this but when I try to access the 'args' variable, I get an EXEC_BAD_ACCESS. What is that I'm not doing correctly here? - (void)info:(NSString *)formatString, ... { va_list args; va_start(args, formatString); ...

OpenGL ES 2.0 (specifically for the iphone) rendering is slightly off. Best guess is it's a projection matrix problem.

So I bought O'reilly's Iphone 3D programming and found what I believe to be a bug in there code. However I can't figure out what the problem is, and unless I do I can't move forward with my own code. I will paste what I consider to be the appropriate code into this post but luckily all the code is available online at: http://examples.or...

Scroll issue when scrolling down the textfield

I am testing a application and something strange is happening. In my UI when I click on a textfield, it comes up as keyboard has to come below it. Now if I click on my done button I get the desired result with all my UI components placed correctly. But when I again click on that textfield and scroll the view down and then press done, my ...

How do I resize a cell in a tableview with grouped cells

I am using a grouped tableview and need to resize 1 cell where the enclosed cell.detailTextLabel has exceeded the size of the cell (i.e. about 3 lines worth). Is there any easy way for the cell to auto-size itself to it's contents or otherwise, how do I change the size of that particular cell? ...

UINavigationController Problem

In a view Controller I am adding a UINavigationController and it has around 20-30 pixels on top of it. It doesnt fit the navigationCOntroller properly. For soem reason it adds the subview 20-30 px below navController = [[UINavigationController alloc] init]; navController.navigationBar.tintColor = [UIColor grayColor]; UnitViewController ...

lifetime of [NSMutableDictionary dictionaryWithCapacity:n]

I thought the object returned by NSMutableDictionary dictionaryWithCapacity: would be released when the autorelease pool in main.m is drained. Instead, when i assign this to an instance member in -init, i find the object only lasts as long as the -init call. What is managing the release of the object returned by NSMutableDictionary dict...

Using a custom UITableView without linking in IB

I have a custom UITableView class for creating shadow effects on all of my UITableViews. Is it possible to incorporate this class with my UITableViewController(s) without creating a nib file for each table view controller? Is there another way to link this custom UITableView other then in IB? ...

how to tell if an NSManagedObject is new

Hi there iPhone developer. I create a new NSManagedObject and then pass it to another view controller. how can i tell in the viewController if the passed NSManagedObject is a new one or an existing one. is there a property that i can use ? Any help will be appreciated. Thanks ...

Infinite UIScrollView for whiteboard-like app

Naturally an "infinite" UIScrollView question has been asked about before, but it always seem to be related to this sort of scenario: A scrollview with 4 card subviews on a "carousel", i.e. reaching the 4th card and then swiping in the direction of continuation would yield the 1st card again (and therefore no need to scroll backwards). ...

Drawing UI components when device orientation changes

Hi, When I open any form in my app in Portrait mode and tap on any textfield (keyboard pops up) and then change the device orientation to landscape, page is no longer scrollable to bottom most UI widgets. But if you open the same page directly in Landscape mode, it works fine I think idea should be like: 1. Capture the change in devic...

NSNotification issue: it's posted but just cached by one instance of the same class, why?

hi guys, here i am again: what i want to do is: if i press a button, then post a notification. This notification should be cached by 2 instances of the same class. the problem: the notification is posted, but it is cached just by one instance. some code and explanation i have 1 tab bar controller i have 3 tabs ( 3 different vie...

C++ Struct in array, help!

Hello - I have an iPhone app that used to use an array of several thousand small objects for its data source. Now, I am trying to make it use C++ Structs, to improve performance. I have written the struct, and put it in "Particle.h": typedef struct{ double changeX; double changeY; double x; double y; }ParticleStruct; The...

Why iAd keeps showing "Testing Advertisement"?

My app is approved on AppStore. In the iAd section of the screen, it keeps showing the black "Testing Advertisement" by Apple instead of a real ad. Is there any configuration I missed? Thanks ...

Two Views in 1 view controller.

Hi all, Basically, what I am trying to do is I have my TestViewController and there are 2 views under it, the first view will start with a tool bar and 2 buttons, one for imagepicker and the other one for mail sending, I am already done with that, and after pick the image from the photo library, the second view will be popped out(I want...

What is the best way to load a custom UIView?

In my iPhone app, I made a custom UIView that I use in several different view controllers to display some information. I'm familiar with making customer table cells for use in a table but I've never made a custom view again. My question is what is the best way to load this view? I've tried simply placing the view in the view controlle...

how to display the name of wifi AP using reachability wifi example on iphone

i want to display the infomation of my WIFI AP to which i am connected , how to do that ??? + (Reachability*) reachabilityForLocalWiFi; {//NSLog(@"cheking all addresss "); struct sockaddr_in localWifiAddress; bzero(&localWifiAddress, sizeof(localWifiAddress)); localWifiAddress.sin_len = sizeof(localWifiAddress); localWi...

UIView in UIView issue

Perhaps I'm missing a property or misunderstanding something but having issues with something simple. I have a UIView with a frame lets say of 100px high in which I have another UIView with lets say 50px high. If set the main UIView to 20px high the 50px high one is fully visible. I thought it might of been something to do with the boun...

Iphone dev app for companies

Lets say I have a client that wishes me to build a business app for the iphone. I would still need to enroll to the standard developer program so that the app can be installed on real devices and the only way for my client to install the app is through the app store? I cannot just distribute it to my client directly? I'm just reading ab...

IPhone App Crashes on Device

I have a simple app (this is my first one) which loads an image from my resources folder, I change my image like this (with the image name changing): myUIImageView.image = [UIImage imageNamed:@"nextImage.jpg"]; It runs really well on the app I can change the image an infinite number of times. But when I run it on my Ipod Touch, it cr...